namespace sys.core
class Point3D
A three dimensional generic vector.
Can be used as a point or a vector.
Predefined specializations:
```C#
alias Point2Di = Point2D
alias Point2Du = Point2D
alias Point2Df = Point2D
alias Point2Dd = Point2D
```
this{value: T};
this{x: T, y: T, z: T};
this{p2d: Point2D, z: T};
Creates a new instance initializing each component of the point.
| value | the value to use for each component |
|---|---|
| x | the first dimension of the point |
| y | the second dimension of the point |
| z | the third dimension of the point |
| p2d | a 2 dimensional point that is used as the first two dimensions |
def Clamp(min: Point3D, max: Point3D);
def Clamp(min: T, max: T);
Clamps each component of the current mutable instance between `min` and `max`.
| min | the minimum value |
|---|---|
| max | the maximum value |
func Clamped(min: Point3D, max: Point3D): Point3D;
func Clamped(min: T, max: T): Point2D;
Returns a copy of the color with each component clamped between `min` and `max`.
| min | the minimum value |
|---|---|
| max | the maximum value |
the clamped value
func GetMin(min: Point3D): Point3D;
Returns the member-wise minimum between the current instance and the input.
| min | the value to test against |
|---|
the member-wise minimum
func GetMax(max: Point3D): Point3D;
Returns the member-wise maximum between the current instance and the input.
| max | the value to test against |
|---|
the member-wise maximum
func IsNormalized(tolerance: T): Bool;
Tests if the current instance is a 3 dimensional normalized vector, within a tolerance.
| tolerance | tolerance for a non zero lengthed vector |
|---|
`true` if normalized
def Normalize(tolerance: T);
Normalizes the 3 dimensional vector if its length falls within the tolerance limits.
Otherwise, the value remains unchanged.
| tolerance | tolerance for a non zero lengthed vector |
|---|
func Normalized(tolerance: T): Point3D;
Returns a 3 dimensional normalized copy of the vector if its length falls within the tolerance limits.
Otherwise, returns the value as is.
| tolerance | tolerance for a non zero lengthed vector |
|---|
`true` if normalized
func @add(second: Point3D): Point3D;
func @add(second: T): Point3D;
Member-wise addition operator. Commutative.
| second | the second operand |
|---|
the result
static func @sub(left: Point3D, right: Point3D): Point3D;
static func @sub(left: Point3D, right: T): Point3D;
static func @sub(left: T, right: Point3D): Point3D;
Member-wise subtraction operator.
| left | the left operand |
|---|---|
| right | the right operand |
the result
func @mul(second: Point3D): Point3D;
func @mul(second: T): Point3D;
Member-wise multiplication operator. Commutative.
| second | the second operand |
|---|
the result
static func @div(left: Point3D, right: Point3D): Point3D;
static func @div(left: Point3D, right: T): Point3D;
static func @div(left: T, right: Point3D): Point3D;
Member-wise division operator.
| left | the left operand |
|---|---|
| right | the right operand |
the result
static func @mod(left: Point3D, right: Point3D): Point3D;
static func @mod(left: Point3D, right: T): Point3D;
static func @mod(left: T, right: Point3D): Point3D;
Member-wise modulo operator.
| left | the left operand |
|---|---|
| right | the right operand |
the result
func @minus(): Point3D;
Returns the member-wise negative of the current instance.
the result
func @eq(second: T): Bool;
Member-wise equality operator.
| second | the second operand |
|---|
`true` if equal
func @neq(second: T): Bool;
Member-wise inequality operator.
| second | the second operand |
|---|
`true` if not equal
func Equals(second: Point3D, tolerance: T): Bool;
func Equals(second: T, tolerance: T): Bool;
Member-wise equality operator within a given tolerance.
| second | the second operand |
|---|---|
| tolerance | tolerance for equality |
`true` if equal
property Length: T; get;
The length of the instance interpreted as a 3 dimensional vector.
property LengthSquared: T; get;
The squred length of the instance interpreted as a 3 dimensional vector.
val X: T;
The first dimension of the point.
val Y: T;
The second dimension of the point.
val Z: T;
The third dimension of the point.