|
Post by bluatigro on Apr 2, 2020 9:29:22 GMT
'' bluatigro 2 apr 2020 '' sphere to x,y,z and x,y,z to sphere '' all angles in radians global pi : pi = atn( 1 ) * 4
end function rad( x ) rad = x * pi / 180 end function function deg( x ) deg = x * 180 / pi end function sub toSphere byref x , byref y , byref z r = sqr( x * x + y * y + z * z ) l = atn( y / x ) b = acs( z / r ) x = r y = l z = b end sub sub toXYZ byref r , byref l , byref b x = r * sin( b ) * cos( l ) y = r * sin( b ) * sin( l ) z = r * cos( b ) r = x l = y b = z end sub
|
|