public interface IPoint
This interface provides read access to the coordinates only, however this does not mean that an instance that implements
IPoint
will always return the same values for the coordinate properties. Often times the instance provides a
dynamic read access to the current state of a point. It depends on the context whether it is allowed to or even
necessary to copy the state of the properties or whether the reference to the instance should always be used to query
the values.
IMutablePoint
,
MutablePoint
Modifier and Type | Method and Description |
---|---|
default double |
distanceTo(IPoint point2)
Calculates the Euclidean distance between two points.
|
double |
getX()
Gets the current x coordinate of this point.
|
double |
getY()
Gets the current y coordinate of this point.
|
default PointD |
toPointD()
Copies the current values of the coordinates of the point to a
PointD struct. |
default double distanceTo(IPoint point2)
point2
- The second point.double getX()
Depending on context the values returned may change over time.
double getY()
Depending on context the values returned may change over time.
default PointD toPointD()
PointD
struct.
This method is useful to obtain a copy of the state and for making use of the various utility methods that are provided
by PointD
.
PointD.toMutablePoint()
,
IMutablePoint.relocate(PointD)