gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.util / org.gvsig.tools.util.api / src / main / java / org / gvsig / euclidean / EuclideanLine2D.java @ 2307
History | View | Annotate | Download (4.95 KB)
1 |
/*
|
---|---|
2 |
* To change this license header, choose License Headers in Project Properties.
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
package org.gvsig.euclidean; |
7 |
|
8 |
import java.awt.geom.Point2D; |
9 |
|
10 |
/**
|
11 |
*
|
12 |
* @author fdiaz
|
13 |
*/
|
14 |
public interface EuclideanLine2D { |
15 |
|
16 |
/**
|
17 |
* Return coeficient A of general equation (Ax + By + C=0).
|
18 |
*
|
19 |
* @return A
|
20 |
*/
|
21 |
public double getA(); |
22 |
|
23 |
/**
|
24 |
* Return coeficient B of general equation (Ax + By + C=0).
|
25 |
*
|
26 |
* @return B
|
27 |
*/
|
28 |
public double getB(); |
29 |
|
30 |
/**
|
31 |
* Return coeficient C of general equation (Ax + By + C=0).
|
32 |
*
|
33 |
* @return C
|
34 |
*/
|
35 |
public double getC(); |
36 |
|
37 |
/**
|
38 |
* Return de slope (m in explicit equation of the line y=m+x+b)
|
39 |
*
|
40 |
* @return m
|
41 |
*/
|
42 |
public double getSlope(); |
43 |
|
44 |
/**
|
45 |
* Return de Y-intercept (b in explicit equation of the line y=m+x+b)
|
46 |
*
|
47 |
* @return b
|
48 |
*/
|
49 |
public double getYIntercept(); |
50 |
|
51 |
/**
|
52 |
* Returns the y coordinate of a point on the line whose x coordinate is the value of the parameter
|
53 |
*
|
54 |
* @param x
|
55 |
* @return y
|
56 |
*/
|
57 |
public double getY(double x); |
58 |
|
59 |
/**
|
60 |
* Returns the x coordinate of a point on the line whose y coordinate is the value of the parameter
|
61 |
*
|
62 |
* @param y
|
63 |
* @return x
|
64 |
*/
|
65 |
public double getX(double y); |
66 |
|
67 |
/**
|
68 |
* Returns the minor angle in radians between this line and the line parameter
|
69 |
*
|
70 |
* @param line
|
71 |
* @return angle (radians)
|
72 |
*/
|
73 |
public double getAngle(EuclideanLine2D line); |
74 |
|
75 |
/**
|
76 |
* Returns the angle in radians between this line and the line parameter in the quadrant containing the point parameter
|
77 |
*
|
78 |
* @param line
|
79 |
* @param quadrant
|
80 |
* @return angle (radians)
|
81 |
*/
|
82 |
public double getAngle(EuclideanLine2D line, Point2D quadrant); |
83 |
|
84 |
/**
|
85 |
* Returns the minor angle in degrees between this line and the line parameter
|
86 |
*
|
87 |
* @param line
|
88 |
* @return angle (degrees)
|
89 |
*/
|
90 |
public double getDegreesAngle(EuclideanLine2D line); |
91 |
|
92 |
/**
|
93 |
* Returns the angle in degrees between this line and the line parameter in the quadrant containing the point parameter
|
94 |
*
|
95 |
* @param line
|
96 |
* @param quadrant
|
97 |
* @return angle (degrees)
|
98 |
*/
|
99 |
public double getDegreesAngle(EuclideanLine2D line, Point2D quadrant); |
100 |
|
101 |
/**
|
102 |
* Returns the distance between this line and the point whose coordinates are the parameters
|
103 |
*
|
104 |
* @param pointX
|
105 |
* @param pointY
|
106 |
* @return distance line-point
|
107 |
*/
|
108 |
public double getDistance(double pointX, double pointY); |
109 |
|
110 |
/**
|
111 |
* Returns the distance between this line and the point
|
112 |
*
|
113 |
* @param point
|
114 |
* @return distance line-point
|
115 |
*/
|
116 |
public double getDistance(Point2D point); |
117 |
|
118 |
/**
|
119 |
* Return the distance between this line and the parameter line
|
120 |
*
|
121 |
* @param line
|
122 |
* @return distance line-line
|
123 |
*/
|
124 |
public double getDistance(EuclideanLine2D line); |
125 |
|
126 |
/**
|
127 |
* Returns true if this line and the line passed as parameter are parallel
|
128 |
*
|
129 |
* @param line
|
130 |
* @return boolean
|
131 |
*/
|
132 |
public boolean isParallel(EuclideanLine2D line); |
133 |
|
134 |
/**
|
135 |
* Returns the intersection between this line and the line passed as parameter
|
136 |
*
|
137 |
* @param line
|
138 |
* @return intersection point
|
139 |
*/
|
140 |
public Point2D getIntersection(EuclideanLine2D line); |
141 |
|
142 |
/**
|
143 |
* Returns a perpendicular line that passes through the point whose coordinates are pointx, pointy
|
144 |
*
|
145 |
* @param pointX
|
146 |
* @param pointY
|
147 |
* @return
|
148 |
*/
|
149 |
public EuclideanLine2D getPerpendicular(double pointX, double pointY); |
150 |
|
151 |
/**
|
152 |
* Returns a perpendicular line that passes through a point
|
153 |
*
|
154 |
* @param point
|
155 |
* @return perpendicular line
|
156 |
*/
|
157 |
public EuclideanLine2D getPerpendicular(Point2D point); |
158 |
|
159 |
/**
|
160 |
* Returns a parallel line that passes through the point whose coordinates are pointx, pointy
|
161 |
*
|
162 |
* @param pointX
|
163 |
* @param pointY
|
164 |
* @return parallel line
|
165 |
*/
|
166 |
public EuclideanLine2D getParallel(double pointX, double pointY); |
167 |
|
168 |
/**
|
169 |
* Returns a parallel line that passes through a point
|
170 |
*
|
171 |
* @param point
|
172 |
* @return parallel line
|
173 |
*/
|
174 |
public EuclideanLine2D getParallel(Point2D point); |
175 |
|
176 |
/**
|
177 |
* Returns the nearest point of this line to the point whose coordinates are pointx, pointy
|
178 |
*
|
179 |
* @param pointX
|
180 |
* @param pointY
|
181 |
* @return nearestPoint
|
182 |
*/
|
183 |
public Point2D getNearestPoint(double pointX, double pointY); |
184 |
|
185 |
/**
|
186 |
* Returns the nearest point of this line to the point
|
187 |
*
|
188 |
* @param point
|
189 |
* @return nearestPoint
|
190 |
*/
|
191 |
public Point2D getNearestPoint(Point2D point); |
192 |
|
193 |
/**
|
194 |
* Returns the bisectors between this line and the line passed as parameter
|
195 |
*
|
196 |
* @param line
|
197 |
* @return bisectors
|
198 |
*/
|
199 |
public EuclideanLine2D[] getBisectors(EuclideanLine2D line); |
200 |
} |