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

xyz.luan.geometry.ShapeBase Maven / Gradle / Ivy

Go to download

Simple geometry package for Java, implementing set operations and area calculation for Polygons.

There is a newer version: 1.5.4
Show newest version
package xyz.luan.geometry;

public abstract class ShapeBase implements Shape {

    protected abstract Shape op(Shape shape, OpType type);

    public Shape intersection(Shape shape) {
        return op(shape, OpType.INTERSECTION);
    }

    public Shape diff(Shape shape) {
        return op(shape, OpType.DIFFERENCE);
    }

    public Shape xor(Shape shape) {
        return op(shape, OpType.XOR);
    }

    public Shape union(Shape shape) {
        return op(shape, OpType.UNION);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy