com.graphbuilder.geom.PointFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of curvesapi Show documentation
Show all versions of curvesapi Show documentation
Implementation of various mathematical curves that define themselves over a set of control points. The API is written in Java. The curves supported are: Bezier, B-Spline, Cardinal Spline, Catmull-Rom Spline, Lagrange, Natural Cubic Spline, and NURBS.
package com.graphbuilder.geom;
public class PointFactory {
static class Point2D implements Point2d {
double [] pts;
public Point2D(double x, double y) {
pts = new double[]{x, y};
}
@Override
public double getX() {
return pts[0];
}
@Override
public double getY() {
return pts[1];
}
@Override
public void setLocation(double[] p) {
pts[0] = p[0];
pts[1] = p[1];
}
@Override
public void setLocation(double x, double y) {
pts[0] = x;
pts[1] = y;
}
@Override
public double[] getLocation() {
return pts;
}
}
public static Point2d create(double x, double y) {
return new Point2D(x, y);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy