Defines a right-handed or left-handed axis in 2D.
An axis is defined by a location point and two perpendicular directions. yDirection is derived from xDirection and the handedness of the axis.
new Axis2d(
location?,xDirection?,isCCWRotation?):Axis2d
Creates an axis.
By default, creates an axis with location `Point2d.origin()` (0, 0), xDirection `Direction2d.xDir()` (1, 0), and yDirection `Direction2d.yDir()` (0, 1).
The provided location point and xDirection are copied.
Point2d = ...
Location point of the axis.
Direction2d = ...
X direction of the axis.
boolean = true
If true, yDirection is defined by counter-clockwise rotation of xDirection; otherwise by clockwise rotation.
Axis2d
get location():
Point2d
Location point of the axis.
set location(
location):void
Sets the location point of the axis.
The coordinates are copied from the provided point.
Location point of the axis.
void
get xDirection():
Direction2d
X direction of the axis.
set xDirection(
direction):void
Sets the X direction of the axis.
The components are copied from the provided direction. Y direction is updated to remain perpendicular to X direction and preserve the current handedness of the axis.
X direction of the axis.
void
get yDirection():
Direction2d
Y direction of the axis.
set yDirection(
direction):void
Sets the Y direction of the axis.
The components are copied from the provided direction. X direction is updated to remain perpendicular to Y direction and preserve the current handedness of the axis.
Y direction of the axis.
void
clone():
Axis2d
Creates a new axis with the same location, xDirection, and yDirection as this axis.
Axis2d
copy(
other):this
Copies the location, xDirection, and yDirection of other to this axis.
The values of the point and directions are copied without replacing the existing point and direction objects of this axis.
Axis2d
Axis to copy.
this
setLocation(
location):this
Sets the location point of the axis.
The coordinates are copied from the provided point.
Location point of the axis.
this
setXDirection(
direction):this
Sets the X direction of the axis.
Y direction is updated to remain perpendicular to X direction and preserve the current handedness of the axis.
X direction of the axis.
this
setYDirection(
direction):this
Sets the Y direction of the axis.
X direction is updated to remain perpendicular to Y direction and preserve the current handedness of the axis.
Y direction of the axis.
this