Points and related quantities
Many calculations require the concept of a point in the plane, i.e. of a quantity able to hold two real values (the two coordinates). Similarly, often we need to consider linear transformations in the plane, represented as 2×2 matrices.
For efficiency reasons, we use throughout our code StaticArrays. We employ two kinds of static arrays: immutable and mutable. Quantities implemented in terms of immutable static arrays are prefixed by an S (SPoint, SPointMap...); quantities implemented in terms of mutable static arrays are prefixed by an M (MPoint, MPointMap...).
Point
A Point represents a point in the plane, i.e. an element of ${\mathbb R}^2$. It is usually used with static allocation, represented by the type SPoint.
Gravity.SPoint — Type
A 2D static point.
Gravity.MPoint — Type
A 2D mutable point.
Gravity.Point — Type
A 2D static (SPoint) or mutable (MPoint) point.
PointMap
A PointMap is a linear map in the plane, i.e. a linear function ${\mathbb R}^2 \rightarrow {\mathbb R}^2$. It is represented as a 2×2 matrix.
Gravity.SPointMap — Type
A static linear mapping from a 2D point to a 2D point.
Gravity.MPointMap — Type
A mutable linear mapping from a 2D point to a 2D point.
Gravity.PointMap — Type
A static or mutable linear mapping from a 2D point to a 2D point.
PointDiff
A PointDiff is an affine map in the plane, i.e. a affine function ${\mathbb R}^2 \rightarrow {\mathbb R}^2$: It is equivalent to a linear map composed with a plane translation. It is represented as a 6-vector, holding both the 4 coefficients of the linear map and the 2 coefficients of the translation.
This kind of object is useful, e.g., when dealing with functions that compute both the lens equation and its differential (Jacobian), such as Gravity.deflectionjacobian or Gravity.lensmapdistortion.
Gravity.SPointDiff — Type
A static type holding a differential for a 2D->2D mapping
Gravity.MPointDiff — Type
A mutable type holding a differential for a 2D->2D mapping
Gravity.PointDiff — Type
A static or mutable type holding a differential for a 2D->2D mapping
ScalarPoint
A ScalarPoint is the combination of a scalar and a 2D point.
This kind of object is useful, e.g., when dealing with functions that compute both the time delay and the lens equation, such as Gravity.timedelaylensmap.
Gravity.SScalarPoint — Type
A static type holding a scalar and a 2D point
Gravity.MScalarPoint — Type
A static type holding a scalar and a 2D point
Gravity.ScalarPoint — Type
A static or mutable type holding a scalar and a 2D point