package io.measures.passage.geometry;

import static io.measures.passage.Sketch.*;

/**
 * Triangle3D
 * @author Dietrich Featherston
 */
public class Triangle3D {

    private final Projectable3D a, b, c;

    public Triangle3D(Projectable3D a, Projectable3D b, Projectable3D c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public Projectable3D a() {
        return a;
    }

    public Projectable3D b() {
        return b;
    }

    public Projectable3D c() {
        return c;
    }

    public Point3D centroid() {
        float x = (a.x() + b.x() + c.x())/3;
        float y = (a.y() + b.y() + c.y())/3;
        float z = (a.z() + b.z() + c.z())/3;
        return new Point3D(x, y, z);
    }

    public float perimeter() {
        return dist(a, b) + dist(b, c) + dist(c, a);
    }
}

@@ -36,53 +36,8 @@
 y;%0A%0A
-import static io.measures.passage.Sketch.*;%0A%0A
 /**%0A
@@ -114,51 +114,28 @@
 e3D 
-%7B%0A%0A    private final Projectable3D a, b, c;
+extends Triangle2D %7B
 %0A%0A  
@@ -219,527 +219,21 @@
     
-this.a = a;%0A        this.b = b;%0A        this.c = c;%0A    %7D%0A%0A    public Projectable3D a() %7B%0A        return a;%0A    %7D%0A%0A    public Projectable3D b() %7B%0A        return b;%0A    %7D%0A%0A    public Projectable3D c() %7B%0A        return c;%0A    %7D%0A%0A    public Point3D centroid() %7B%0A        float x = (a.x() + b.x() + c.x())/3;%0A        float y = (a.y() + b.y() + c.y())/3;%0A        float z = (a.z() + b.z() + c.z())/3;%0A        return new Point3D(x, y, z);%0A    %7D%0A%0A    public float perimeter() %7B%0A        return dist(a, b) + dist(b, c) + dist(c, a
+super(a, b, c
 );%0A 

remove cruft from triangle3d