Vec2D

Description

struct Tinman.Core.Math.Vectors.Vec2D

Derived from

IVec2Ops<Vec2D, float64>

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

/     \
|  X  |
|  Y  |
\     /

Public / Constants

Undefined


public static readonly attribute Undefined → (Vec2D)

A vector with undefined value.

Zero


public static readonly attribute Zero → (Vec2D)

The zero vector.

Public / Constructors

Vec2​D


public constructor Vec2D → (2)

in : float64

X-coordinate of vector.

in : float64

Y-coordinate of vector.

Creates a new instance of Vec2D.

Public / Methods

Barycentric


[Pure]
public method Barycentric → (3)

in : Vec2D

First vertex of triangle.

in : Vec2D

Second vertex of triangle.

in : Vec2D

Third vertex of triangle.

returns → Vec3D

The barycentric coordinates of this vector, where Vec3D.X, Vec3D.Y and Vec3D.Z represent the weights for the triangle vertices in, in and in (in this order). This vector lies inside of the given triangle iff Vec3D.X, Vec3D.Y and Vec3D.Z are non-negative.

Computes the barycentric coordinates of this vector in the given triangle.

Public / Attributes

X


public readonly attribute X → (float64)

X-coordinate of vector.

Y


public readonly attribute Y → (float64)

Y-coordinate of vector.

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializerEx<Vec2D>)

The serialization helper object for values of Vec2D.