1 package de.lathanda.eos.geo;
3 import de.lathanda.eos.base.layout.BalancePoint;
5 import de.lathanda.eos.base.Picture;
6 import de.lathanda.eos.base.layout.BoundingBox;
7 import de.lathanda.eos.base.math.Point;
8 import de.lathanda.eos.base.layout.Transform;
16 private static final int A = 0;
17 private static final int B = 1;
18 private static final int C = 2;
22 points =
new Point[3];
23 points[A] =
new Point(-10,0);
24 points[B] =
new Point(10,0);
25 points[C] =
new Point(0,10);
34 points[A].
scale(factor);
35 points[B].
scale(factor);
36 points[C].
scale(factor);
38 public void setCorners(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3) {
40 points[A] =
new Point(x1, y1);
41 points[B] =
new Point(x2, y2);
42 points[C] =
new Point(x3, y3);
64 tri.points =
new Point[3];
65 for(
int i = 0; i < 3; i++) {
66 tri.points[i] =
new Point(points[i]);
74 double xa = points[A].
getX();
75 double xb = points[B].
getX();
76 double xc = points[C].
getX();
77 double ya = points[A].
getY();
78 double yb = points[B].
getY();
79 double yc = points[C].
getY();
80 area = Math.abs((xa-xb)*(ya-yc)-(ya-yb)*(xa-xc));
83 private void recenter() {
86 for(
Point p : points) {
93 points[A].move(-x, -y);
94 points[B].move(-x, -y);
95 points[C].move(-x, -y);
abstract void drawPolygon(double[] x, double[] y)
void scale(double factor)
void drawObject(Picture p)
BalancePoint getBalancePoint()
BoundingBox calculateBoundingBox(Transform base, Transform own)
void scaleInternal(double factor)
void setCorners(double x1, double y1, double x2, double y2, double x3, double y3)