namespace UglyToad.Pdf.Geometry
{
///
/// A point in a PDF file.
///
///
/// PDF coordinates are defined with the origin at the lower left (0, 0).
/// The Y-axis extends vertically upwards and the X-axis horizontally to the right.
/// Unless otherwise specified on a per-page basis, units in PDF space are equivalent to a typographic point (1/72 inch).
///
public struct PdfPoint
{
///
/// The origin of the coordinates system.
///
public static PdfPoint Origin = new PdfPoint(0m, 0m);
///
/// The X coordinate for this point. (Horizontal axis).
///
public decimal X { get; }
///
/// The Y coordinate of this point. (Vertical axis).
///
public decimal Y { get; }
///
/// Create a new at this position.
///
public PdfPoint(decimal x, decimal y)
{
X = x;
Y = y;
}
///
/// Create a new at this position.
///
public PdfPoint(int x, int y)
{
X = x;
Y = y;
}
///
/// Create a new at this position.
///
public PdfPoint(double x, double y)
{
X = (decimal)x;
Y = (decimal)y;
}
///
/// Get a string representation of this point.
///
public override string ToString()
{
return $"(x:{X}, y:{Y})";
}
}
}