001/** 002 * Copyright (c) 2011, The University of Southampton and the individual contributors. 003 * All rights reserved. 004 * 005 * Redistribution and use in source and binary forms, with or without modification, 006 * are permitted provided that the following conditions are met: 007 * 008 * * Redistributions of source code must retain the above copyright notice, 009 * this list of conditions and the following disclaimer. 010 * 011 * * Redistributions in binary form must reproduce the above copyright notice, 012 * this list of conditions and the following disclaimer in the documentation 013 * and/or other materials provided with the distribution. 014 * 015 * * Neither the name of the University of Southampton nor the names of its 016 * contributors may be used to endorse or promote products derived from this 017 * software without specific prior written permission. 018 * 019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 029 */ 030package org.openimaj.math.geometry.point; 031 032import Jama.Matrix; 033 034/** 035 * Interface representing a point in 3d space with x and y coordinates 036 * 037 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk) 038 */ 039public interface Point3d extends Coordinate { 040 /** 041 * @return x coordinate of point 042 */ 043 public double getX(); 044 045 /** 046 * Set x coordinate of point 047 * 048 * @param x 049 * x-coordinate 050 */ 051 public void setX(double x); 052 053 /** 054 * @return y coordinate of point 055 */ 056 public double getY(); 057 058 /** 059 * Set y coordinate of point 060 * 061 * @param y 062 * y-coordinate 063 */ 064 public void setY(double y); 065 066 /** 067 * @return z coordinate of point 068 */ 069 public double getZ(); 070 071 /** 072 * Set z coordinate of point 073 * 074 * @param z 075 * z-coordinate 076 */ 077 public void setZ(double z); 078 079 /** 080 * Copy the values of the given point into this point. 081 * 082 * @param p 083 * The point to copy values from. 084 */ 085 public void copyFrom(Point3d p); 086 087 /** 088 * Clone the point 089 * 090 * @return a copy of the point 091 */ 092 public Point3d copy(); 093 094 /** 095 * Translate the position of the point by the given amounts 096 * 097 * @param x 098 * x-amount 099 * @param y 100 * y-amount 101 * @param z 102 * z-amount 103 */ 104 public void translate(double x, double y, double z); 105 106 /** 107 * Transform the point by the given matrix 108 * 109 * @param m 110 * @return a copy 111 */ 112 public Point3d transform(Matrix m); 113 114 /** 115 * Take point point from another point such that return = this - a 116 * 117 * @param a 118 * @return a new point 119 */ 120 public Point3d minus(Point3d a); 121 122 /** 123 * Translate the position of the point by the given amounts 124 * 125 * @param v 126 * the vector to translate by 127 */ 128 void translate(Point3d v); 129}