public class Coords2d extends Abstract2d
| Modifier and Type | Field and Description |
|---|---|
static Coords2d |
ZERO
The coordinate of the origin.
|
x, y| Constructor and Description |
|---|
Coords2d(double x,
double y)
Instantiating a new coordinate with the given coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
static Coords2d |
midPoint(Coords2d a,
Coords2d b)
Calculates the midpoint of the ab segment.
|
Coords2d |
move(Coords2d move)
Moving this coordinate by the given vector, but this object will be unchanged and
this method will create a new object with the new coordinates.
|
Coords3d |
withZ(double z)
Creating a 3D coordinate by defining the Z value.
|
static Coords2d |
xOnly(double x)
Creates a coordinate where the Y and Z fields are zero.
|
static Coords2d |
yOnly(double y)
Creates a coordinate where the X and Z fields are zero.
|
public static final Coords2d ZERO
public Coords2d(double x,
double y)
x - X coordinatey - Y coordinatepublic static Coords2d midPoint(Coords2d a, Coords2d b)
a - first pointb - second pointpublic Coords3d withZ(double z)
z - Z coordinatepublic Coords2d move(Coords2d move)
move - the vector used by the movepublic static Coords2d xOnly(double x)
x - the X coordinatepublic static Coords2d yOnly(double y)
y - the Y coordinateCopyright © 2014–2020, Printing in 3D. All rights reserved.