blob: 3f2d545e9e1f896fd1a96f37a6c756ffcbc4b694 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package org.singinst.uf.presenter;
import org.singinst.uf.math.SimplePoint;
public class SimpleLine {
public final SimplePoint p1;
public final SimplePoint p2;
public SimpleLine(SimplePoint p1, SimplePoint p2) {
this.p1 = p1;
this.p2 = p2;
}
public static SimpleLine vertical(double x, double y1, double y2) {
return new SimpleLine(new SimplePoint(x, y1), new SimplePoint(x, y2));
}
public static SimpleLine horizontal(double x1, double x2, double y) {
return new SimpleLine(new SimplePoint(x1, y), new SimplePoint(x2, y));
}
}
|