Module geomath::prelude::coordinates [−][src]
Expand description
Coordinates accessors
Get and Set coordinates of 2D and 3D vectors.
Conventions
A coherent naming convention between polar, cylindrical and spherical coordinates has been established.
Coordinates naming
3D coordinates representation in geomath
The four basic coordinates systems are represented
- (x, y, z) the cartesian coordinates
- (rho, phi, z) the polar/cylindrical coordinates
- (r, phi, theta) the spherical coordinates
The traits are implemented such that there is no code repetition between the systems that have coordinates
in common. For example, since the angle phi is common to polar and spherical coordinates
systems it will be only defined in the Polar
trait.
Notes :
- The value of phi remains the same in both polar/cylindrical and spherical coordinates systems
- The value of r in the schema above is denoted
radius
in the code - The z coordinate is common to cartesian and cylindrical coordinates systems
Local basis
You can generate vectors of the local basis of each coordinate system, the convention is described in the schemas bellow.
Traits
Cylindrical coordinates accessors
Homogeneous coordinates transforms
Polar coordinates accessors
Spherical coordinates accessors