StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
				https://doi.org/10.1109/TVCG.2020.3030352
			
			
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							27 lines
						
					
					
						
							604 B
						
					
					
				
			
		
		
	
	
							27 lines
						
					
					
						
							604 B
						
					
					
				| module.exports = angle
 | |
| 
 | |
| var fromValues = require('./fromValues')
 | |
| var normalize = require('./normalize')
 | |
| var dot = require('./dot')
 | |
| 
 | |
| /**
 | |
|  * Get the angle between two 3D vectors
 | |
|  * @param {vec3} a The first operand
 | |
|  * @param {vec3} b The second operand
 | |
|  * @returns {Number} The angle in radians
 | |
|  */
 | |
| function angle(a, b) {
 | |
|     var tempA = fromValues(a[0], a[1], a[2])
 | |
|     var tempB = fromValues(b[0], b[1], b[2])
 | |
|  
 | |
|     normalize(tempA, tempA)
 | |
|     normalize(tempB, tempB)
 | |
|  
 | |
|     var cosine = dot(tempA, tempB)
 | |
| 
 | |
|     if(cosine > 1.0){
 | |
|         return 0
 | |
|     } else {
 | |
|         return Math.acos(cosine)
 | |
|     }     
 | |
| }
 | |
| 
 |