Record Class Vec2
java.lang.Object
java.lang.Record
org.variantsync.diffdetective.show.engine.geom.Vec2
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(double x, double y) static Vec2
all
(double val) double
distanceTo
(Vec2 b) final boolean
Indicates whether some other object is "equal to" this one.flip()
static Vec2
static Vec2
final int
hashCode()
Returns a hash code value for this object.double
length()
scale
(double s) toString()
Returns a string representation of this record class.double
x()
Returns the value of thex
record component.double
y()
Returns the value of they
record component.
-
Field Details
-
x
private final double xThe field for thex
record component. -
y
private final double yThe field for they
record component.
-
-
Constructor Details
-
Vec2
public Vec2(double x, double y) Creates an instance of aVec2
record class.- Parameters:
x
- the value for thex
record componenty
- the value for they
record component
-
-
Method Details
-
all
-
from
-
from
-
toPoint2D
-
scale
-
scale
-
dividedBy
-
add
-
add
-
flip
-
minus
-
normalize
-
length
public double length() -
distanceTo
-
rotate90DegreesClockwise
-
rotate90DegreesCounterClockwise
-
transform
-
deltaTransform
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
x
public double x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public double y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-