Vec3d
Namespace Mc.Scripting · Kind struct
public struct Vec3d : IEquatable<Vec3d>A 3D vector of doubles (positions, velocities).
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
Vec3d(double x, double y, double z) |
Creates a vector. |
Constructor
Section titled “Constructor”public Vec3d(double x, double y, double z)Creates a vector.
Parameters
| Name | Type | Description |
|---|---|---|
x |
double |
|
y |
double |
|
z |
double |
Fields
Section titled “Fields”| Member | Description |
|---|---|
double X |
Components. |
double Y |
Components. |
double Z |
Components. |
public double X;Components.
public double Y;Components.
public double Z;Components.
Properties
Section titled “Properties”| Member | Description |
|---|---|
double Length { get; } |
The length of the vector. |
static Vec3d Zero { get; } |
The zero vector. |
Length
Section titled “Length”public double Length { get; }The length of the vector.
public static Vec3d Zero { get; }The zero vector.
Methods
Section titled “Methods”| Member | Description |
|---|---|
double DistanceTo(Vec3d other) |
The distance to another point. |
bool Equals(Vec3d o) |
Equality. |
override bool Equals(object? obj) |
Equality. |
override int GetHashCode() |
Hash code. |
override string ToString() |
Text form. |
DistanceTo
Section titled “DistanceTo”public double DistanceTo(Vec3d other)The distance to another point.
Parameters
| Name | Type | Description |
|---|---|---|
other |
Vec3d |
The other point. |
Returns double
Equals
Section titled “Equals”public bool Equals(Vec3d o)Equality.
Parameters
| Name | Type | Description |
|---|---|---|
o |
Vec3d |
Returns bool
Equals
Section titled “Equals”public override bool Equals(object? obj)Equality.
Parameters
| Name | Type | Description |
|---|---|---|
obj |
object? |
Returns bool
GetHashCode
Section titled “GetHashCode”public override int GetHashCode()Hash code.
Returns int
ToString
Section titled “ToString”public override string ToString()Text form.
Returns string
Operators
Section titled “Operators”| Member | Description |
|---|---|
static bool operator !=(Vec3d a, Vec3d b) |
Inequality. |
static Vec3d operator *(Vec3d a, double s) |
Scales the vector. |
static Vec3d operator +(Vec3d a, Vec3d b) |
Component-wise sum. |
static Vec3d operator -(Vec3d a, Vec3d b) |
Component-wise difference. |
static bool operator ==(Vec3d a, Vec3d b) |
Equality. |
operator !=
Section titled “operator !=”public static bool operator !=(Vec3d a, Vec3d b)Inequality.
Parameters
| Name | Type | Description |
|---|---|---|
a |
Vec3d |
|
b |
Vec3d |
Returns bool
operator *
Section titled “operator *”public static Vec3d operator *(Vec3d a, double s)Scales the vector.
Parameters
| Name | Type | Description |
|---|---|---|
a |
Vec3d |
|
s |
double |
Returns Vec3d
operator +
Section titled “operator +”public static Vec3d operator +(Vec3d a, Vec3d b)Component-wise sum.
Parameters
| Name | Type | Description |
|---|---|---|
a |
Vec3d |
|
b |
Vec3d |
Returns Vec3d
operator -
Section titled “operator -”public static Vec3d operator -(Vec3d a, Vec3d b)Component-wise difference.
Parameters
| Name | Type | Description |
|---|---|---|
a |
Vec3d |
|
b |
Vec3d |
Returns Vec3d
operator ==
Section titled “operator ==”public static bool operator ==(Vec3d a, Vec3d b)Equality.
Parameters
| Name | Type | Description |
|---|---|---|
a |
Vec3d |
|
b |
Vec3d |
Returns bool