All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphbuilder.geom.PointFactory Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.08
Show newest version
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