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 @ 2338
History | View | Annotate | Download (5.45 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 angle in radians between this line and x-axis
|
69 |
*
|
70 |
* @return angle (radians)
|
71 |
*/
|
72 |
public double getAngle(); |
73 |
|
74 |
/**
|
75 |
* Returns the angle in degrees between this line and x-axis
|
76 |
*
|
77 |
* @return angle (radians)
|
78 |
*/
|
79 |
public double getDegreesAngle(); |
80 |
|
81 |
/**
|
82 |
* Returns the minor angle in radians between this line and the line parameter
|
83 |
*
|
84 |
* @param line
|
85 |
* @return angle (radians)
|
86 |
*/
|
87 |
public double getAngle(EuclideanLine2D line); |
88 |
|
89 |
/**
|
90 |
* Returns the angle in radians between this line and the line parameter in the quadrant containing the point parameter
|
91 |
*
|
92 |
* @param line
|
93 |
* @param quadrant
|
94 |
* @return angle (radians)
|
95 |
*/
|
96 |
public double getAngle(EuclideanLine2D line, Point2D quadrant); |
97 |
|
98 |
/**
|
99 |
* Returns the minor angle in degrees between this line and the line parameter
|
100 |
*
|
101 |
* @param line
|
102 |
* @return angle (degrees)
|
103 |
*/
|
104 |
public double getDegreesAngle(EuclideanLine2D line); |
105 |
|
106 |
/**
|
107 |
* Returns the angle in degrees between this line and the line parameter in the quadrant containing the point parameter
|
108 |
*
|
109 |
* @param line
|
110 |
* @param quadrant
|
111 |
* @return angle (degrees)
|
112 |
*/
|
113 |
public double getDegreesAngle(EuclideanLine2D line, Point2D quadrant); |
114 |
|
115 |
/**
|
116 |
* Returns the distance between this line and the point whose coordinates are the parameters
|
117 |
*
|
118 |
* @param pointX
|
119 |
* @param pointY
|
120 |
* @return distance line-point
|
121 |
*/
|
122 |
public double getDistance(double pointX, double pointY); |
123 |
|
124 |
/**
|
125 |
* Returns the distance between this line and the point
|
126 |
*
|
127 |
* @param point
|
128 |
* @return distance line-point
|
129 |
*/
|
130 |
public double getDistance(Point2D point); |
131 |
|
132 |
/**
|
133 |
* Return the distance between this line and the parameter line
|
134 |
*
|
135 |
* @param line
|
136 |
* @return distance line-line
|
137 |
*/
|
138 |
public double getDistance(EuclideanLine2D line); |
139 |
|
140 |
/**
|
141 |
* Returns true if this line and the line passed as parameter are parallel
|
142 |
*
|
143 |
* @param line
|
144 |
* @return boolean
|
145 |
*/
|
146 |
public boolean isParallel(EuclideanLine2D line); |
147 |
|
148 |
/**
|
149 |
* Returns true if this line and the line passed as parameter are perpendicular
|
150 |
*
|
151 |
* @param line
|
152 |
* @return boolean
|
153 |
*/
|
154 |
public boolean isPerpendicularl(EuclideanLine2D line); |
155 |
|
156 |
/**
|
157 |
* Returns the intersection between this line and the line passed as parameter
|
158 |
*
|
159 |
* @param line
|
160 |
* @return intersection point
|
161 |
*/
|
162 |
public Point2D getIntersection(EuclideanLine2D line); |
163 |
|
164 |
/**
|
165 |
* Returns a perpendicular line that passes through the point whose coordinates are pointx, pointy
|
166 |
*
|
167 |
* @param pointX
|
168 |
* @param pointY
|
169 |
* @return
|
170 |
*/
|
171 |
public EuclideanLine2D getPerpendicular(double pointX, double pointY); |
172 |
|
173 |
/**
|
174 |
* Returns a perpendicular line that passes through a point
|
175 |
*
|
176 |
* @param point
|
177 |
* @return perpendicular line
|
178 |
*/
|
179 |
public EuclideanLine2D getPerpendicular(Point2D point); |
180 |
|
181 |
/**
|
182 |
* Returns a parallel line that passes through the point whose coordinates are pointx, pointy
|
183 |
*
|
184 |
* @param pointX
|
185 |
* @param pointY
|
186 |
* @return parallel line
|
187 |
*/
|
188 |
public EuclideanLine2D getParallel(double pointX, double pointY); |
189 |
|
190 |
/**
|
191 |
* Returns a parallel line that passes through a point
|
192 |
*
|
193 |
* @param point
|
194 |
* @return parallel line
|
195 |
*/
|
196 |
public EuclideanLine2D getParallel(Point2D point); |
197 |
|
198 |
/**
|
199 |
* Returns the nearest point of this line to the point whose coordinates are pointx, pointy
|
200 |
*
|
201 |
* @param pointX
|
202 |
* @param pointY
|
203 |
* @return nearestPoint
|
204 |
*/
|
205 |
public Point2D getNearestPoint(double pointX, double pointY); |
206 |
|
207 |
/**
|
208 |
* Returns the nearest point of this line to the point
|
209 |
*
|
210 |
* @param point
|
211 |
* @return nearestPoint
|
212 |
*/
|
213 |
public Point2D getNearestPoint(Point2D point); |
214 |
|
215 |
/**
|
216 |
* Returns the bisectors between this line and the line passed as parameter
|
217 |
*
|
218 |
* @param line
|
219 |
* @return bisectors
|
220 |
*/
|
221 |
public EuclideanLine2D[] getBisectors(EuclideanLine2D line); |
222 |
} |