java.lang.Object
org.spongepowered.math.vector.Vector2l
- All Implemented Interfaces:
Serializable,Comparable<Vector2l>,Vectorl
@Immutable
public final class Vector2l
extends Object
implements Vectorl, Comparable<Vector2l>, Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()add(double x, double y) add(long x, long y) intdoubledistance(double x, double y) doubledistance(long x, long y) doublelongdistanceSquared(double x, double y) longdistanceSquared(long x, long y) longdiv(double a) div(double x, double y) div(long a) div(long x, long y) longdot(double x, double y) longdot(long x, long y) longbooleanstatic Vector2lfrom(long n) static Vector2lfrom(long x, long y) inthashCode()doublelength()longmax(double x, double y) max(long x, long y) intmaxAxis()Return the axis with the maximum value.min(double x, double y) min(long x, long y) intminAxis()Return the axis with the minimal value.mul(double a) mul(double x, double y) mul(long a) mul(long x, long y) negate()pow(double pow) pow(long power) project(double x, double y) project(long x, long y) sub(double x, double y) sub(long x, long y) long[]toArray()toDouble()toFloat()toInt()toLong()toString()toVector3(double z) toVector3(long z) toVector4(double z, double w) toVector4(long z, long w) withX(double x) withX(long x) withY(double y) withY(long y) longx()longy()
-
Field Details
-
ZERO
-
UNIT_X
-
UNIT_Y
-
ONE
-
-
Constructor Details
-
Vector2l
-
Vector2l
-
Vector2l
-
Vector2l
public Vector2l(double x, double y) -
Vector2l
public Vector2l(long x, long y)
-
-
Method Details
-
x
public long x() -
withX
-
withX
-
y
public long y() -
withY
-
withY
-
add
-
add
-
add
-
sub
-
sub
-
sub
-
mul
-
mul
-
mul
-
mul
-
mul
-
div
-
div
-
div
-
div
-
div
-
dot
-
dot
public long dot(double x, double y) -
dot
public long dot(long x, long y) -
project
-
project
-
project
-
pow
-
pow
-
abs
-
negate
-
min
-
min
-
min
-
max
-
max
-
max
-
distanceSquared
-
distanceSquared
public long distanceSquared(double x, double y) -
distanceSquared
public long distanceSquared(long x, long y) -
distance
-
distance
public double distance(double x, double y) -
distance
public double distance(long x, long y) -
lengthSquared
public long lengthSquared()- Specified by:
lengthSquaredin interfaceVectorl
-
length
public double length() -
minAxis
public int minAxis()Return the axis with the minimal value. -
maxAxis
public int maxAxis()Return the axis with the maximum value. -
toVector3
-
toVector3
-
toVector3
-
toVector4
-
toVector4
-
toVector4
-
toVectorN
-
toArray
public long[] toArray() -
toInt
-
toLong
-
toFloat
-
toDouble
-
compareTo
- Specified by:
compareToin interfaceComparable<Vector2l>
-
equals
-
hashCode
public int hashCode() -
toString
-
from
-
from
-