<<<<<<<<<<<<<<<<<

coordinate(oscar) Animation coordinate(oscar)

NAME

coordinate - object to perform 3D coordinate conversions

DESCRIPTION

The coordinate class allows the user to set and get coordinates in several different forms (cartesian, polar, cylindrical, and spherical).

SUPERCLASS

vector

INSTANCE VARIABLES

None.

MESSAGES

In the descriptions below, x, y, and z are the normal cartesian coordinates, v is the vector from the origin to (x,y,z), r is the length of v, phi is the angle of v in the xy plane, and theta is the angle of v in the yz plane.

components= (x,y,z) Set coordinate value using cartesian coordinates.

components? Get coordinate value in cartesian coordinates.

cylindrical= (r,phi,z) Set coordinate value in cylindrical coordinates.

cylindrical? Get coordinate value in cylindrical coordinates.

dimension= Overridden from vector. No effect. The vector's dimension is fixed at 3.

dimension? Overridden from vector. No effect.

polar= (r,phi) Set coordinate value using polar coordinates.

polar? Get coordinate value in polar coordinates.

spherical= (r,phi,theta) Set coordinate value using spherical coordinates.

spherical? Get coordinate value in spherical coordinates.

EXAMPLES

The LYMB script

coordinate new: c

components=(1,1,1) print:spherical print:cylindrical print:polar print:components ;

displays

c: spherical= (1.000000,90.000008,90.000000) c: cylindrical= (1.000000,90.000008,0.000000) c: polar= (1.000000,90.000008) c: components= (1.000000,1.000000,1.000000)

SEE ALSO

vector, transform


Please send comments and suggestions to
consult@rpi.edu