<Spherical>.add value
Returns new spherical point by adding the argument to the current point. If the argument is spherical point the result would be a translation of two vectors otherwise the add function will effect only on radius.
Example:
a = spherical 2.0 30.0 90.0 , b = spherical 5.0 10.0 -20.0
a.add b returns spherical 7.0 40.0 70.0
a.add 12 returns spherical 14.0 30.0 90.0
<Spherical>.sub value
Returns new spherical point by subtracting the value from the current point. If the argument is spherical point the result would be a translation of the current vector and the reveres vector otherwise the sub function will effect only on radius.
Example:
a = spherical 2.0 30.0 90.0 , b = spherical 5.0 10.0 -20.0
a.sub b returns spherical -3.0 20.0 110.0
a.sub -2 returns spherical 4.0 30.0 90.0
<Spherical>.times value
Returns new spherical point includes production of corresponding components of two points. If the operator is scalar value the new result would be scaled vector in same orientation as the current point.
Example:
a = spherical 2.0 30.0 90.0 , b = spherical 5.0 10.0 -20.0
a.times b returns spherical 10.0 300.0 -1800.0
a.times 3 returns spherical 6.0 30.0 90.0
<Spherical>.div value
Returns new spherical point includes division of corresponding components of two points. If the operator is scalar value the new result would be scaled vector in same orientation as the current point.
Example:
a = spherical 2.0 30.0 90.0 , b = spherical 5.0 10.0 -20.0
a.div b returns spherical 0.4 3.0 -4.5
a.div 2.0 returns spherical 1.0 30.0 90.0
<Spherical>.addVector point3
This function performs translation of the current point and the point3 value in Cartesian coordinate and returns the result in spherical format.
Example:
a = spherical 5.0 30.0 90.0
a.addvector [-2,0,10] returns (spherical rad:15.1327 theta:180.0 phi:82.4054)