TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct Vec3D in Tinman.Core.Math.Vectors

A three-dimensional vector with 64-bit floating-point precision.

struct Vec3D implements IEquatable<Vec3D>

Remarks

/     \
|  X  |
|  Y  |
|  Z  |
\     /

Public / Attributes

IsUndefined

Checks if this vector has an undefined value.

public property IsUndefined { get }
type bool
value true if this vector has an undefined value, false if not.

Remarks:

A vector is undefined if at least one component is NaN (not-a-number).

Length

Returns the length of this vector.

public property Length { get }
type float64
value [>=0] The vector length.

LengthSqr

Returns the squared length of this vector.

public property LengthSqr { get }
type float64
value [>=0] The squared vector length.

X

X-coordinate of vector.

public readonly field X
type float64

Y

Y-coordinate of vector.

public readonly field Y
type float64

Z

Z-coordinate of vector.

public readonly field Z
type float64

Public / Constants

Undefined

A vector with undefined value.

public static readonly field Undefined
type Vec3D

Zero

The zero vector.

public static readonly field Zero
type Vec3D

Public / Constructors

Vec3D

Creates a new instance of Vec3D.

public constructor Vec3D (float64 x, float64 y, float64 z)
params x X-coordinate of vector.
  y Y-coordinate of vector.
  z Z-coordinate of vector.

Public / Methods

Add

Adds this vector and the given one.

[Pure]
public method Add (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Adds this vector and the given one.

[Pure]
public method Add (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Ceiling

Computes the component-wise ceiling of this vector.

[Pure]
public method Ceiling ()
type Vec3D
returns The resulting vector.

Choose

Chooses a component of this vector.

[Pure]
public method Choose (int32 idx, float64 v = 0)
type float64
params idx The zero-based component index.
  v The value to return if idx is out of range. Defaults to 0.
returns The resulting vector.

Cross

Computes the cross product between this vector and the given one.

[Pure]
public method Cross (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Computes the cross product between this vector and the given one.

[Pure]
public method Cross (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Div

Divides this vector by the given scalar value.

[Pure]
public method Div (float64 v)
type Vec3D
params v The scalar value.
returns The resulting vector.

Dot

Computes the dot product between this vector and the given one.

[Pure]
public method Dot (Vec3D v)
type float64
params v The vector.
returns The resulting vector.

Computes the dot product between this vector and the given one.

[Pure]
public method Dot (float64 x, float64 y, float64 z)
type float64
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Equals

Compares this object with the given one.

[Pure]
public method Equals (Vec3D other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.

Checks if this vector and the given one are equal.

[Pure]
public method Equals (float64 x, float64 y, float64 z)
type bool
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns true if both vectors are equal, false if they are not.

EqualsAlmost

Checks if this vector and the given one are similar but necessarily equal.

[Pure]
public method EqualsAlmost (Vec3D v)
type bool
params v The vector.
returns true if both vectors are similar, false if they are not.

See also:

Maths.Similar

Checks if this vector and the given one are similar but necessarily equal.

[Pure]
public method EqualsAlmost (float64 x, float64 y, float64 z)
type bool
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns true if both vectors are similar, false if they are not.

See also:

Maths.Similar

Floor

Computes the component-wise floor of this vector.

[Pure]
public method Floor ()
type Vec3D
returns The resulting vector.

GetHashCode

[Pure]
public override method GetHashCode ()
type int32

Max

Computes the component-wise maximum of this vector and the given one.

[Pure]
public method Max (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Computes the component-wise maximum of this vector and the given one.

[Pure]
public method Max (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Min

Computes the component-wise minimum of this vector and the given one.

[Pure]
public method Min (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Computes the component-wise minimum of this vector and the given one.

[Pure]
public method Min (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Mul

Multiplies this vector with the given one.

[Pure]
public method Mul (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Multiplies this vector with the given scalar value.

[Pure]
public method Mul (float64 v)
type Vec3D
params v The scalar value.
returns The resulting vector.

Multiplies this vector with the given one.

[Pure]
public method Mul (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

Neg

Negates this vector.

[Pure]
public method Neg ()
type Vec3D
returns The resulting vector.

Norm

Normalizes this vector to unit length.

[Pure]
public method Norm ()
type Vec3D
returns The resulting vector.

Sub

Subtracts the given vector from this one.

[Pure]
public method Sub (Vec3D v)
type Vec3D
params v The vector.
returns The resulting vector.

Subtracts the given vector from this one.

[Pure]
public method Sub (float64 x, float64 y, float64 z)
type Vec3D
params x X-component of vector.
  y Y-component of vector.
  z Z-component of vector.
returns The resulting vector.

ToString

[Pure]
public override method ToString ()
type string

Serialization

Serializer

The serialization helper object for values of Vec3D.

public static readonly field Serializer
type ITypeSerializerEx<Vec3D>