public class CoordDouble
extends java.lang.Object
implements java.io.Serializable
com.badlogic.gdx.math.Vector2
class in preference to this
one if you are OK with using floats instead of doubles.
Constructor and Description |
---|
CoordDouble() |
CoordDouble(Coord other) |
CoordDouble(CoordDouble other) |
CoordDouble(double x,
double y) |
Modifier and Type | Method and Description |
---|---|
CoordDouble |
add(CoordDouble other) |
CoordDouble |
add(double x,
double y) |
CoordDouble |
copy()
Constructs an identical copy to this CoordDouble, making a new object that may be mutated independently.
|
double |
cross(CoordDouble other)
Gets the cross product of this CoordDouble and
other . |
double |
distance(CoordDouble co) |
double |
distance(double x2,
double y2) |
double |
distanceSq(CoordDouble co) |
double |
distanceSq(double x2,
double y2) |
CoordDouble |
divide(CoordDouble other)
Divides the x component of this CoordDouble by
other.x and the y component by other.y . |
CoordDouble |
divide(double x,
double y)
Divides the x component of this CoordDouble by
x and the y component by y . |
double |
dot(CoordDouble other)
Gets the dot product of this CoordDouble and
other . |
boolean |
equals(java.lang.Object o) |
static CoordDouble |
get(double x,
double y) |
double |
getX() |
double |
getY() |
int |
hashCode() |
double |
length()
Distance from the origin to this CoordDouble.
|
double |
lengthSq()
Distance from the origin to this CoordDouble, squared.
|
CoordDouble |
multiply(CoordDouble other) |
CoordDouble |
multiply(double x,
double y) |
CoordDouble |
set(CoordDouble co) |
CoordDouble |
set(double x,
double y) |
void |
setX(double x) |
void |
setY(double y) |
CoordDouble |
subtract(CoordDouble other) |
CoordDouble |
subtract(double x,
double y) |
java.lang.String |
toString() |
public CoordDouble()
public CoordDouble(double x, double y)
public CoordDouble(CoordDouble other)
public CoordDouble(Coord other)
public static CoordDouble get(double x, double y)
public CoordDouble copy()
public CoordDouble add(double x, double y)
public CoordDouble add(CoordDouble other)
public CoordDouble subtract(double x, double y)
public CoordDouble subtract(CoordDouble other)
public CoordDouble multiply(double x, double y)
public CoordDouble multiply(CoordDouble other)
public CoordDouble divide(double x, double y)
x
and the y component by y
. Be careful about when
either of the parameters can be 0.0, since that can put NaN or infinite components in this.x
- divisor for xy
- divisor for ypublic CoordDouble divide(CoordDouble other)
other.x
and the y component by other.y
. Be careful
about when either of other's components can be 0.0, since that can put NaN or infinite components in this.other
- a non-null CoordDouble to get divisors frompublic double dot(CoordDouble other)
other
.other
- another CoordDouble; must not be null.other
.public double cross(CoordDouble other)
other
.other
- another CoordDouble; must not be null.other
.public CoordDouble set(double x, double y)
public CoordDouble set(CoordDouble co)
public double length()
public double lengthSq()
public double distance(double x2, double y2)
public double distance(CoordDouble co)
public double distanceSq(double x2, double y2)
public double distanceSq(CoordDouble co)
public double getX()
public void setX(double x)
public double getY()
public void setY(double y)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Copyright © Eben Howard 2012–2022. All rights reserved.