public Vector getSpinVector ( double theta , double phi ) { Vector spinvector = new Vector ( 3 ) ; spinvector . vector [ 0 ] = Math . sin ( theta ) * Math . cos ( phi ) ; spinvector . vector [ 1 ] = Math . sin ( theta ) * Math . sin ( phi ) ; spinvector . vector [ 2 ] = Math . cos ( phi ) ; return spinvector ; }
Calculates a spin vector by a direction specified by theta and phi