Table of Contents

Class Vec2d

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll

Represents a vector of 2 doubles. Go bug Tyron of you need more utility methods in this class.

public class Vec2d
Inheritance
Vec2d
Inherited Members
Extension Methods

Constructors

Vec2d()

public Vec2d()

Vec2d(double, double)

public Vec2d(double x, double y)

Parameters

x double
y double

Fields

X

public double X

Field Value

double

Y

public double Y

Field Value

double

Methods

DistanceTo(double, double)

public double DistanceTo(double targetX, double targetY)

Parameters

targetX double
targetY double

Returns

double

DistanceTo(Vec2d)

public double DistanceTo(Vec2d pos)

Parameters

pos Vec2d

Returns

double

Dot(double, double)

public double Dot(double x, double y)

Parameters

x double
y double

Returns

double

Dot(Vec2d)

public double Dot(Vec2d a)

Parameters

a Vec2d

Returns

double

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

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

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Length()

public double Length()

Returns

double

LengthSq()

public double LengthSq()

Returns

double

Normalize()

public Vec2d Normalize()

Returns

Vec2d

Set(double, double)

public Vec2d Set(double x, double z)

Parameters

x double
z double

Returns

Vec2d

Operators

operator +(Vec2d, float)

public static Vec2d operator +(Vec2d left, float right)

Parameters

left Vec2d
right float

Returns

Vec2d

operator +(Vec2d, Vec2d)

public static Vec2d operator +(Vec2d left, Vec2d right)

Parameters

left Vec2d
right Vec2d

Returns

Vec2d

operator +(Vec2d, Vec2i)

public static Vec2d operator +(Vec2d left, Vec2i right)

Parameters

left Vec2d
right Vec2i

Returns

Vec2d

operator /(Vec2d, float)

public static Vec2d operator /(Vec2d left, float right)

Parameters

left Vec2d
right float

Returns

Vec2d

operator ==(Vec2d, Vec2d)

public static bool operator ==(Vec2d left, Vec2d right)

Parameters

left Vec2d
right Vec2d

Returns

bool

operator !=(Vec2d, Vec2d)

public static bool operator !=(Vec2d left, Vec2d right)

Parameters

left Vec2d
right Vec2d

Returns

bool

operator *(double, Vec2d)

public static Vec2d operator *(double left, Vec2d right)

Parameters

left double
right Vec2d

Returns

Vec2d

operator *(float, Vec2d)

public static Vec2d operator *(float left, Vec2d right)

Parameters

left float
right Vec2d

Returns

Vec2d

operator *(Vec2d, double)

public static Vec2d operator *(Vec2d left, double right)

Parameters

left Vec2d
right double

Returns

Vec2d

operator *(Vec2d, float)

public static Vec2d operator *(Vec2d left, float right)

Parameters

left Vec2d
right float

Returns

Vec2d

operator *(Vec2d, Vec2d)

public static double operator *(Vec2d left, Vec2d right)

Parameters

left Vec2d
right Vec2d

Returns

double

operator -(float, Vec2d)

public static Vec2d operator -(float left, Vec2d right)

Parameters

left float
right Vec2d

Returns

Vec2d

operator -(Vec2d, float)

public static Vec2d operator -(Vec2d left, float right)

Parameters

left Vec2d
right float

Returns

Vec2d

operator -(Vec2d, Vec2d)

public static Vec2d operator -(Vec2d left, Vec2d right)

Parameters

left Vec2d
right Vec2d

Returns

Vec2d