Coords
A coords instance is a tuple of double-precision coordinates with
respect to some coordinate system.
Operations get and set individual coordinates.
Implementations:
- Coords_1D
A single coordinate.
- Coords_2D
A pair of coordinates.
- Coords_ND
A vector of coordinates. Constructor args:
int num_coords.
- TCoords_ND
A vector of coordinates. Template parameter:
int num_coords.
Member functions:
- coord: Coords . int -> double
Returns the coordinate
on the given dimension.
- num_coords: Coords -> int
Returns the number of coordinates.
- set_coord: Coords . int . double -> void
Sets the coordinate
on the given dimension.
Secondary operations:
- add: Coords . Coords . Coords -> void
Sets the
coordinates of the third from the sum of the coordinates of the first two.
- bbox: CoordsContainer . Coords min . Coords max -> void
Sets the coordinates of min and max from the bounding box of the
coordinates in the container.
- centroid: CoordsContainer . Coords c -> void
Sets the coordinates of c from the centroid of the
coordinates in the container.
- compare: Coords . Coords c -> int
Returns -1, 0, or 1 for less-than, equal-to, greater-than.
- construct: Coords . c1 . c2 .... -> void
Sets the
coordinates.
- copy: Coords . Coords -> void
Sets the coordinates of
the second from the first.
- cosangle: Coords p . Coords r . Coords q -> double
Returns the cosine of the angle prq. 2D coords only.
- distance_euclidean: Coords . Coords -> double
Returns the
euclidean distance between the coords.
- distance_euclidean2: Coords . Coords -> double
Returns the
squared euclidean distance between the coords.
- dot: Coords . Coords -> double
Returns the
dot product of the coords.
- enumerate_coords_by_axis:
Coords min . Coords max . Coords delta . CoordsContainer -> void
Steps through coordinate system from min to max by delta, storing
Coords in the sequence. Dimension 0 is the outer loop, dimension 1 is
the next-to-outer, etc.
- less_than: Geom . Geom -> bool
Returns whether or not
the first is lexicographically less than the second.
- normalize: Coords . Coords -> void
Sets the
coordinates to be of unit length.
- orient: Coords . Coords . Coords -> int
Returns 1 if
the sequence of coords goes clockwise (right); -1 if it goes left. 2D
coords only.
- pseudocos: Coords p . Coords r . Coords q -> int
For angles very close to 0 or to pi, returns approximately
(1 - cos prq) or (1 + cos prq) respectively. 2D coords only.
- scale: Coords . double . Coords -> void
Sets the
coordinates of the second by scaling those of the first.
- subtract: Coords . Coords . Coords -> void
Sets the
coordinates of the third from the difference of the coordinates of the
first two.
- vector_length: Coords -> void
Returns the length of
the vector defined by the coordinates.
- vector_length2: Coords -> void
Returns the squared
length of the vector defined by the coordinates.