/** Point label with cartesian coordinates (x,y) */ private final GeoPoint Point(String label, double x, double y) { GeoPoint p = new GeoPoint(cons); p.setCoords(x, y, 1.0); p.setMode(Kernel.COORD_CARTESIAN); p.setLabel(label); // invokes add() return p; }
public AlgoPointOnPath(Construction cons, Path path, double x, double y) { super(cons); this.path = path; // create point on path and compute current location P = new GeoPoint(cons); P.setPath(path); P.setCoords(x, y, 1.0); setInputOutput(); // for AlgoElement addIncidence(); }
// calc axes @Override public final void compute() { // only parabola has directrix if (c.type == GeoConicNDConstants.CONIC_PARABOLA) { // directrix has direction of second eigenvector // through point (b - p/2* eigenvec1) directrix.x = -eigenvec[1].getY(); directrix.y = eigenvec[1].getX(); double px = b.getX() - c.p / 2.0 * eigenvec[0].getX(); double py = b.getY() - c.p / 2.0 * eigenvec[0].getY(); directrix.z = -(directrix.x * px + directrix.y * py); P.setCoords(px, py, 1.0); } else directrix.setUndefined(); }
@Override public final void compute() { // bugfix Michael Borcherds // undefined unless A is a point on f if (!f.isOnPath(A, Kernel.MIN_PRECISION)) { circle.setUndefined(); return; } double radius = 1 / Math.abs(curv.getValue()); double r2 = radius * radius; double x = r2 * v.x; double y = r2 * v.y; R.setCoords(A.inhomX + x, A.inhomY + y, 1.0); circle.setCircle(R, A); }