1 package edu.berkeley.qfat.geom;
2 import javax.media.opengl.*;
4 /** a line segment defined by two points in space */
5 public class Segment implements HasBoundingBox {
10 public Segment(Point p1, Point p2) { this.p1 = p1; this.p2 = p2; }
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); }