checkpoint
[anneal.git] / src / edu / berkeley / qfat / geom / Segment.java
1 package edu.berkeley.qfat.geom;
2 import javax.media.opengl.*;
3
4 /** a line segment defined by two points in space */
5 public class Segment implements HasBoundingBox {
6
7     public final Point p1;
8     public final Point p2;
9
10     public Segment(Point p1, Point p2) { this.p1 = p1; this.p2 = p2; }
11
12     public float getMaxX() { return Math.max(p1.x, p2.x); }
13     public float getMinX() { return Math.min(p1.x, p2.x); }
14     public float getMaxY() { return Math.max(p1.y, p2.y); }
15     public float getMinY() { return Math.min(p1.y, p2.y); }
16     public float getMaxZ() { return Math.max(p1.z, p2.z); }
17     public float getMinZ() { return Math.min(p1.z, p2.z); }
18
19 }