Class ASCoordinate
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.types.ASObject
-
- com.adobe.internal.pdftoolkit.core.types.ASCoordinate
-
public class ASCoordinate extends ASObject
ASCoordinate represents a PDF coordintate point (x, y).
-
-
Constructor Summary
Constructors Constructor Description ASCoordinate(double x, double y)
ASCoordinate(ASCoordinate coordinate)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
angleTo(ASCoordinate coord)
Find the angle as measured along a line from this coordinate to the specified coordinate.double
distanceTo(ASCoordinate coord)
Find the shortest Euclidean distance between this coordinate point and the specified coordinate point.double
distanceToSquare(ASCoordinate coord)
Find the square of shortest Euclidean distance between this coordinate point and the specified coordinate point.java.lang.String
toString()
ASCoordinate
transform(ASMatrix ctm)
Transform the coordinate by a coordinate transformation matrix.ASCoordinate
translate(double dx, double dy)
Translate the coordinate by dx, dyvoid
write(OutputByteStream outputByteStream)
Writes the ASCoordinate in to the given OutputStream in the format expected by the PDF Spec.double
x()
double
y()
-
-
-
Constructor Detail
-
ASCoordinate
public ASCoordinate(double x, double y)
- Parameters:
x
-y
-
-
ASCoordinate
public ASCoordinate(ASCoordinate coordinate)
Copy constructor.- Parameters:
coordinate
-
-
-
Method Detail
-
translate
public ASCoordinate translate(double dx, double dy)
Translate the coordinate by dx, dy- Parameters:
dx
- The x offsetdy
- The y offset- Returns:
- A new coordinate offset by dx, dy
-
transform
public ASCoordinate transform(ASMatrix ctm)
Transform the coordinate by a coordinate transformation matrix.- Parameters:
ctm
- - Coordinate Transformation Matrix- Returns:
- ASCoordinate
-
distanceTo
public double distanceTo(ASCoordinate coord)
Find the shortest Euclidean distance between this coordinate point and the specified coordinate point.- Parameters:
coord
-
-
distanceToSquare
public double distanceToSquare(ASCoordinate coord)
Find the square of shortest Euclidean distance between this coordinate point and the specified coordinate point.- Parameters:
coord
-- Returns:
- double
-
angleTo
public double angleTo(ASCoordinate coord)
Find the angle as measured along a line from this coordinate to the specified coordinate.- Parameters:
coord
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
write
public void write(OutputByteStream outputByteStream) throws PDFIOException
Writes the ASCoordinate in to the given OutputStream in the format expected by the PDF Spec.- Specified by:
write
in classASObject
- Parameters:
outputByteStream
- OutputStream to write to.- Throws:
PDFIOException
-
x
public double x()
-
y
public double y()
-
-