Skip to content

Vector4

Namespace: Hex1b.Scene.Math

Assembly: Hex1b.dll

A 4D vector for homogeneous coordinates (used in matrix transformations).

csharp
[Experimental("HEX1B_SCENE", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/scene.md")]
public struct Vector4 : IEquatable<Vector4>

Implements

Constructors

Vector4(float, float, float, float)

Parameters:

csharp
public Vector4(float x = 0, float y = 0, float z = 0, float w = 1)

Vector4(Vector3, float)

Parameters:

csharp
public Vector4(Vector3 xyz, float w = 1)

Properties

Magnitude

Returns: Single

csharp
public float Magnitude { get; }

Normalized

Returns: Vector4

csharp
public Vector4 Normalized { get; }

One

Returns: Vector4

csharp
public static Vector4 One { get; }

SqrMagnitude

Returns: Single

csharp
public float SqrMagnitude { get; }

UnitW

Returns: Vector4

csharp
public static Vector4 UnitW { get; }

UnitX

Returns: Vector4

csharp
public static Vector4 UnitX { get; }

UnitY

Returns: Vector4

csharp
public static Vector4 UnitY { get; }

UnitZ

Returns: Vector4

csharp
public static Vector4 UnitZ { get; }

W

Returns: Single

csharp
public float W { readonly get; set; }

X

Returns: Single

csharp
public float X { readonly get; set; }

Y

Returns: Single

csharp
public float Y { readonly get; set; }

Z

Returns: Single

csharp
public float Z { readonly get; set; }

Zero

Returns: Vector4

csharp
public static Vector4 Zero { get; }

Methods

Dot(Vector4, Vector4)

Parameters:

Returns: Single

csharp
public static float Dot(Vector4 a, Vector4 b)

Equals(object?)

Indicates whether this instance and a specified object are equal.

Parameters:

  • obj (Object): The object to compare with the current instance.

Returns: Boolean

true if obj and this instance are the same type and represent the same value; otherwise, false.

csharp
public override bool Equals(object? obj)

Equals(Vector4)

Indicates whether the current object is equal to another object of the same type.

Parameters:

  • other (Vector4): An object to compare with this object.

Returns: Boolean

true if the current object is equal to the other parameter; otherwise, false.

csharp
public bool Equals(Vector4 other)

GetHashCode()

Returns the hash code for this instance.

Returns: Int32

A 32-bit signed integer that is the hash code for this instance.

csharp
public override int GetHashCode()

Lerp(Vector4, Vector4, float)

Parameters:

Returns: Vector4

csharp
public static Vector4 Lerp(Vector4 a, Vector4 b, float t)

ToString()

Returns the fully qualified type name of this instance.

Returns: String

The fully qualified type name.

csharp
public override string ToString()

Members

operator -(Vector4, Vector4)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator -(Vector4 a, Vector4 b)

operator -(Vector4)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator -(Vector4 v)

operator *(float, Vector4)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator *(float scalar, Vector4 v)

operator *(Vector4, float)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator *(Vector4 v, float scalar)

operator /(Vector4, float)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator /(Vector4 v, float scalar)

operator +(Vector4, Vector4)

Parameters:

Returns: Vector4

csharp
public static Vector4 operator +(Vector4 a, Vector4 b)

Released under the MIT License.