Statistics
| Revision:

svn-gvsig-desktop / tags / Root_CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / geo / Point3D.java @ 1732

History | View | Annotate | Download (864 Bytes)

1
/*
2
 * Created on 24-may-2004
3
 */
4
package org.cresques.geo;
5

    
6
        import java.awt.geom.Point2D;
7

    
8
/**
9
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
10
 */
11
public class Point3D extends Point2D {
12
        public double X, Y, Z;
13

    
14
        public Point3D() {
15
                setLocation(0.0,0.0); }
16
        public Point3D(double x, double y) {
17
                setLocation(x, y); }
18
        public Point3D(double x, double y, double z) {
19
                setLocation(x, y, z); }
20
        public Point3D(Point2D pt) {
21
                setLocation(pt.getX(), pt.getY()); }
22
        public Point3D(Point3D pt) {
23
                setLocation(pt.getX(), pt.getY(), pt.getZ()); }
24

    
25
        public double getX() { return X; }
26
        public double getY() { return Y; }
27
        public double getZ() { return Z; }
28
        public void setLocation(double x, double y) {X=x; Y=y; Z=0D; }
29
        public void setLocation(double x, double y, double z) {
30
                X=x; Y=y; Z=z; }
31

    
32

    
33
        public String toString() {
34
                return "("+getX()+","+getY()+")";
35
        }
36
}