Interface Point1D<RP extends Point1D<? super RP,? super RV,? super RS>,RV extends Vector1D<? super RV,? super RP,? super RS>,RS extends Segment1D<?,?>>
-
- Type Parameters:
RP- is the type of point that can be returned by this point.RV- is the type of vector that can be returned by this point.RS- is the type of segment that can be returned by this point.
- All Superinterfaces:
Cloneable,Comparable<Point1D<?,?,?>>,JsonableObject,Serializable,Tuple2D<RP>
- All Known Subinterfaces:
UnmodifiablePoint1D<RP,RV,RS>
- All Known Implementing Classes:
ImmutablePoint1D,InnerComputationPoint1afp,Point1d,Point1dfx
public interface Point1D<RP extends Point1D<? super RP,? super RV,? super RS>,RV extends Vector1D<? super RV,? super RP,? super RS>,RS extends Segment1D<?,?>> extends Tuple2D<RP>, Comparable<Point1D<?,?,?>>
1.5D Point.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RP$minus(double scalar)Subtract the scalar to this point:this - scalar.default RV$minus(Point2D<?,?> pt)Subtract the p point to this point:this - p.default RP$minus(Vector2D<?,?> v)Subtract the v vector to this point:this - v.default RP$plus(double scalar)Sum of this point and a scalar:this + scalar.default RP$plus(Vector2D<?,?> v)Sum of this point and a vector:this + v.default voidadd(double curvilineMove)Add the given values to this point.default doubleclamp()Clamp the curviline coordinate to the segment.default intcompareTo(Point1D<?,?,?> point)default booleanepsilonEquals(Point1D<?,?,?> tuple, double epsilon)Returnstrueif the L-infinite distance between this point and point p is less than or equal to the epsilon parameter, otherwise returnsfalse.booleanequals(Object object)Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.default booleanequals(Point1D<?,?,?> tuple)Replies if this point is equals to the given point.default doublegetCurvilineCoordinate()Replies the curviline coordinate.default doublegetDistance(Point1D<?,?,?> p1)Computes the distance between this point and point p1.default doublegetDistanceCurviline(Point1D<?,?,?> p1)Computes the curviline distance between this point and point p1.default doublegetDistanceL1(Point1D<?,?,?> p1)Computes the L-1 (Manhattan) distance between this point and point p1.default doublegetDistanceLinf(Point1D<?,?,?> p1)Computes the L-infinite distance between this point and point p1.default doublegetDistanceShift(Point1D<?,?,?> p1)Computes the jutting distance between this point and point p1.default doublegetDistanceSquared(Point1D<?,?,?> p1)Computes the square of the distance between this point and point p1.GeomFactory1D<RV,RP>getGeomFactory()Replies the geometry factory associated to this point.default doublegetLateralDistance()Replies the lateral distance.RSgetSegment()Replies the segment.inthashCode()Returns a hash number based on the data values in this object.default booleanisOnSameSegment(Point1D<?,?,?> point)Replies if this point is located on the same segment as the given one.default booleanisOnSegment()Replies if this pint is located on the segment.default voidoperator_add(Vector2D<?,?> v)Increment this point with the given vector:this += v.default Point1D<? extends RP,? extends RV,? extends RS>operator_elvis(Point1D<? extends RP,? extends RV,? extends RS> pt)If this point is epsilon equal to zero then reply p else reply this:this ?: p.default booleanoperator_equals(Tuple2D<?> v)Replies if the given vector is equal to this vector:this == v.default RPoperator_minus(double scalar)Subtract the scalar to this point:this - scalar.default RVoperator_minus(Point2D<?,?> pt)Subtract the p point to this point:this - p.default RPoperator_minus(Vector2D<?,?> v)Subtract the v vector to this point:this - v.default booleanoperator_notEquals(Tuple2D<?> v)Replies if the given vector is different than this vector:this != v.default RPoperator_plus(double scalar)Sum of this point and a scalar:this + scalar.default RPoperator_plus(Vector2D<?,?> v)Sum of this point and a vector:this + v.default voidoperator_remove(Vector2D<?,?> v)Subtract the v vector to this:this -= v.default doubleoperator_upTo(Point1D<?,?,?> pt)Replies if the distance between this and the p point:this .. p.default voidset(Point1D<? extends RP,? extends RV,? extends RS> point)Set this point from the given informations.voidset(RS segment, double curviline, double shift)Set this point from the given informations.default voidset(RS segment, Tuple2D<?> tuple)Set this point from the given informations.default voidsetCurvilineCoordinate(double curviline)Set the curviline coordinate.default voidsetLateralDistance(double distance)Set the shift distance.default voidsetSegment(RS segment)Set the segment.default voidsub(double curvilineMove)Substract the given values to this point.UnmodifiablePoint1D<RP,RV,RS>toUnmodifiable()Replies an unmodifiable copy of this point.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Tuple2D
absolute, absolute, add, add, addX, addX, addY, addY, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, clone, epsilonEquals, equals, get, get, get, getX, getY, interpolate, interpolate, ix, iy, negate, negate, scale, scale, scale, scale, set, set, set, set, set, setX, setX, setY, setY, sub, sub, subX, subX, subY, subY
-
-
-
-
Method Detail
-
compareTo
default int compareTo(Point1D<?,?,?> point)
-
clamp
default double clamp()
Clamp the curviline coordinate to the segment.- Returns:
- the amount that was removed from the coordinate. If the amount is negative it means that the coordinate was negative and clamped to zero. If the amount if positive it means that the coordinate was greater than the segment length and clamped to this length. If the amount is equal to zero it mean that the coordinate was not clamped.
-
isOnSegment
@Pure default boolean isOnSegment()
Replies if this pint is located on the segment.The point is located on the segment only if its curviline coordinate is in
[0;length], wherelengthis the length of the segment.- Returns:
trueif the point is on the segment, otherwisefalse
-
isOnSameSegment
@Pure default boolean isOnSameSegment(Point1D<?,?,?> point)
Replies if this point is located on the same segment as the given one.- Parameters:
point- the point to test.- Returns:
trueif the points are on the same segment, otherwisefalse.
-
equals
boolean equals(Object object)
Description copied from interface:Tuple2DReturns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.
-
equals
@Pure default boolean equals(Point1D<?,?,?> tuple)
Replies if this point is equals to the given point.- Parameters:
tuple- the point to test.- Returns:
trueif this point has the same coordinates on the same segment as for the given point.
-
epsilonEquals
@Pure default boolean epsilonEquals(Point1D<?,?,?> tuple, double epsilon)
Returnstrueif the L-infinite distance between this point and point p is less than or equal to the epsilon parameter, otherwise returnsfalse. The L-infinite distance is equal to MAX[abs(curviline-curviline), abs(curviline-curviline)].If the points are not on the same segments, they are not equals.
- Parameters:
tuple- the point to be compared to this pointepsilon- the threshold value.- Returns:
trueif the points are equals, otherwisefalse
-
hashCode
@Pure int hashCode()
Returns a hash number based on the data values in this object. Two different Point1D5 objects with identical data values (ie, returns true for equals(Point1D5) ) will return the same hash number. Two vectors with different data members may return the same hash value, although this is not likely.
-
add
default void add(double curvilineMove)
Add the given values to this point.- Parameters:
curvilineMove- is the quantity to add to the curviline coordinate.
-
sub
default void sub(double curvilineMove)
Substract the given values to this point.- Parameters:
curvilineMove- is the quantity to substract to the curviline coordinate.
-
getDistanceSquared
@Pure default double getDistanceSquared(Point1D<?,?,?> p1)
Computes the square of the distance between this point and point p1.- Parameters:
p1- the other point- Returns:
- the square of the distance
-
getDistance
@Pure default double getDistance(Point1D<?,?,?> p1)
Computes the distance between this point and point p1.- Parameters:
p1- the other point- Returns:
- the distance or
Double.POSITIVE_INFINITYif not on the same segments.
-
getDistanceL1
@Pure default double getDistanceL1(Point1D<?,?,?> p1)
Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(curviline1-curviline2) + abs(jutting1-jutting2).- Parameters:
p1- the other point- Returns:
- the manhattan distance or
Double.POSITIVE_INFINITYif not on the same segments.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point1D<?,?,?> p1)
Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(curviline1-curviline2), abs(jutting1-jutting2)].- Parameters:
p1- the other point- Returns:
- the L-infinite distance or
Double.POSITIVE_INFINITYif not on the same segments.
-
getDistanceCurviline
@Pure default double getDistanceCurviline(Point1D<?,?,?> p1)
Computes the curviline distance between this point and point p1. The curviline distance is equal to abs(curviline1-curviline2).- Parameters:
p1- the other point- Returns:
- the curviline distance or
Double.POSITIVE_INFINITYif not on the same segments.
-
getDistanceShift
@Pure default double getDistanceShift(Point1D<?,?,?> p1)
Computes the jutting distance between this point and point p1. The jutting distance is equal to abs(jutting1-jutting2).- Parameters:
p1- the other point- Returns:
- the jutting distance or
Double.POSITIVE_INFINITYif not on the same segments.
-
getCurvilineCoordinate
@Pure default double getCurvilineCoordinate()
Replies the curviline coordinate.- Returns:
- the curviline coordinate.
-
setCurvilineCoordinate
default void setCurvilineCoordinate(double curviline)
Set the curviline coordinate.- Parameters:
curviline- is the curviline coordinate.
-
getLateralDistance
@Pure default double getLateralDistance()
Replies the lateral distance.- Returns:
- the lateral distance.
-
setLateralDistance
default void setLateralDistance(double distance)
Set the shift distance.- Parameters:
distance- is the shift distance.
-
getSegment
@Pure RS getSegment()
Replies the segment.- Returns:
- the segment or
nullif the weak reference has lost the segment.
-
setSegment
default void setSegment(RS segment)
Set the segment.- Parameters:
segment- is the segment.
-
set
void set(RS segment, double curviline, double shift)
Set this point from the given informations.- Parameters:
segment- the segmentcurviline- the curviline coordinateshift- the jutting coordinate
-
set
@Pure default void set(RS segment, Tuple2D<?> tuple)
Set this point from the given informations.- Parameters:
segment- the segmenttuple- are the coordinates of the point.
-
set
default void set(Point1D<? extends RP,? extends RV,? extends RS> point)
Set this point from the given informations.- Parameters:
point- are the coordinates of the point.
-
toUnmodifiable
@Pure UnmodifiablePoint1D<RP,RV,RS> toUnmodifiable()
Replies an unmodifiable copy of this point.- Returns:
- an unmodifiable copy.
-
getGeomFactory
@Pure GeomFactory1D<RV,RP> getGeomFactory()
Replies the geometry factory associated to this point.- Returns:
- the factory.
-
operator_plus
@Pure default RP operator_plus(Vector2D<?,?> v)
Sum of this point and a vector:this + v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector to add- Returns:
- the result.
-
operator_plus
@Pure default RP operator_plus(double scalar)
Sum of this point and a scalar:this + scalar.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
The operation
v + thisis supported byTuple2DExtensions.operator_plus(double, Point2D).- Parameters:
scalar- the scalar- Returns:
- the result.
- See Also:
Tuple2DExtensions.operator_plus(double, Point2D)
-
operator_add
default void operator_add(Vector2D<?,?> v)
Increment this point with the given vector:this += v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector to add- See Also:
Tuple2D.add(double, double)
-
operator_minus
@Pure default RP operator_minus(Vector2D<?,?> v)
Subtract the v vector to this point:this - v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector to substract.- Returns:
- the result.
-
operator_minus
@Pure default RP operator_minus(double scalar)
Subtract the scalar to this point:this - scalar.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
The operation
scalar - thisis supported byTuple2DExtensions.operator_minus(double, Point2D).- Parameters:
scalar- the scalar.- Returns:
- the result.
- See Also:
Tuple2DExtensions.operator_minus(double, Point2D)
-
operator_minus
@Pure default RV operator_minus(Point2D<?,?> pt)
Subtract the p point to this point:this - p.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
pt- the point to substract- Returns:
- the vector from the p to this.
- See Also:
Vector2D.sub(Point2D, Point2D)
-
operator_remove
default void operator_remove(Vector2D<?,?> v)
Subtract the v vector to this:this -= v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector to substract.
-
operator_equals
@Pure default boolean operator_equals(Tuple2D<?> v)
Replies if the given vector is equal to this vector:this == v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector.- Returns:
- test result.
- See Also:
Tuple2D.equals(Tuple2D)
-
operator_notEquals
@Pure default boolean operator_notEquals(Tuple2D<?> v)
Replies if the given vector is different than this vector:this != v.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
v- the vector.- Returns:
- test result.
- See Also:
Tuple2D.equals(Tuple2D)
-
operator_upTo
@Pure default double operator_upTo(Point1D<?,?,?> pt)
Replies if the distance between this and the p point:this .. p.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
pt- the point.- Returns:
- the distance.
- See Also:
getDistance(Point1D)
-
operator_elvis
@Pure default Point1D<? extends RP,? extends RV,? extends RS> operator_elvis(Point1D<? extends RP,? extends RV,? extends RS> pt)
If this point is epsilon equal to zero then reply p else reply this:this ?: p.This function is an implementation of the operator for the languages that defined or based on the Xtext framework.
- Parameters:
pt- the point.- Returns:
- the point.
-
$plus
@Pure default RP $plus(Vector2D<?,?> v)
Sum of this point and a vector:this + v.This function is an implementation of the operator for the Scala Language.
- Parameters:
v- the vector to add- Returns:
- the result.
-
$plus
@Pure default RP $plus(double scalar)
Sum of this point and a scalar:this + scalar.This function is an implementation of the operator for the Scala Language.
The operation
v + thisis supported byTuple2DExtensions.$plus(double, Point2D).- Parameters:
scalar- the scalar- Returns:
- the result.
- See Also:
Tuple2DExtensions.$plus(double, Point2D)
-
$minus
@Pure default RP $minus(Vector2D<?,?> v)
Subtract the v vector to this point:this - v.This function is an implementation of the operator for the Scala Language.
- Parameters:
v- the vector to substract.- Returns:
- the result.
-
$minus
@Pure default RP $minus(double scalar)
Subtract the scalar to this point:this - scalar.This function is an implementation of the operator for the Scala Language.
The operation
scalar - thisis supported byTuple2DExtensions.$minus(double, Point2D).- Parameters:
scalar- the scalar.- Returns:
- the result.
- See Also:
Tuple2DExtensions.$minus(double, Point2D)
-
$minus
@Pure default RV $minus(Point2D<?,?> pt)
Subtract the p point to this point:this - p.This function is an implementation of the operator for the Scala Language.
- Parameters:
pt- the point to substract- Returns:
- the vector from the p to this.
-
-