Created
January 7, 2013 15:36
-
-
Save thisMagpie/4475883 to your computer and use it in GitHub Desktop.
Belongs in Vector3D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //sets the x y and z coordinate in a more compact way (saves a bit of space when calling the coordinates) | |
| public void setDim(int i, double dimension) { | |
| switch (i) { | |
| case 0: | |
| x = dimension; | |
| break; | |
| case 1: | |
| y = dimension; | |
| break; | |
| case 2: | |
| z = dimension; | |
| break; | |
| } | |
| } | |
| /* *********************** */ | |
| /* ******* Getters ******* */ | |
| /* *********************** */ | |
| //returns the x, y and z coordinates respectively | |
| public double getDim(int i) { | |
| double dimension = 0.0; | |
| switch (i) { | |
| case 0: | |
| dimension = x; | |
| break; | |
| case 1: | |
| dimension = y; | |
| break; | |
| case 2: | |
| dimension = z; | |
| break; | |
| } | |
| return dimension; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment