Class CartesianPositivePlane
java.lang.Object
jaba.cartesian.CartesianPositivePlane
This class manages and draws points in a dimensional cartesian plane. This
class draws just the first quadrant of the plane.
- Author:
- Sebastiano Spicuglia
-
Constructor Summary
ConstructorsConstructorDescriptionCartesianPositivePlane(Graphics2D g, DPoint origin, int xAxisLength, int yAxisLength, double xMaxValue, double yMaxValue) Creates a new CartesianPositivePlane object -
Method Summary
Modifier and TypeMethodDescriptionvoidDraws the planevoidDraws the the orthogonal projection of the point @p onto the x-axisvoidDraws the the orthogonal projection of the point @p onto the y-axisvoiddrawSegment(DPoint p1, DPoint p2) Draws a segment between two pointsvoiddrawValuesOnXAxis(ArrayList<DPoint> points) Draws the value of the abscissa for all points in the @points list.voiddrawValuesOnYAxis(ArrayList<DPoint> points) Draws the value of the ordinate for all points in the @points list.Returns the coordinates of the @p point (on the graphics context) into the planeReturns the coordinates of the @p point into the graphics contextReturns the coordinates of the @p point into the graphics contextintgetTrueX(double x) Returns the x-coordinate of the @x point into the graphics contextintgetTrueY(double y) Returns the y-coordinate of the @y point into the graphics context
-
Constructor Details
-
CartesianPositivePlane
public CartesianPositivePlane(Graphics2D g, DPoint origin, int xAxisLength, int yAxisLength, double xMaxValue, double yMaxValue) throws Exception Creates a new CartesianPositivePlane object- Parameters:
g- the specified Graphics contextorigin- the point on g where to place the origin of the planexAxisLength- the x-axis lengthyAxisLength- the y-axis lengthxMaxValue- the max value of abscissa you want to place on the graphyMaxValue- the max value of ordinate you want to place on the graph- Throws:
Exception
-
-
Method Details
-
drawValuesOnXAxis
-
drawValuesOnYAxis
-
drawProjectionOnTheXAxis
Draws the the orthogonal projection of the point @p onto the x-axis- Parameters:
p- a point
-
drawProjectionOnTheYAxis
Draws the the orthogonal projection of the point @p onto the y-axis- Parameters:
p- a point
-
draw
-
drawSegment
-
getTrueX
public int getTrueX(double x) Returns the x-coordinate of the @x point into the graphics context- Parameters:
x- a point- Returns:
- the x-coordinate of the @x point into the graphics context
-
getTrueY
public int getTrueY(double y) Returns the y-coordinate of the @y point into the graphics context- Parameters:
y- a point- Returns:
- the y-coordinate of the @y point into the graphics context
-
getTruePoint
-
getTruePoint
-
getGraphPointFromTruePoint
-