Skip to content

Commit

Permalink
Added addition for double
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendel committed May 28, 2019
1 parent 181b918 commit 85e4688
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions PluginBase/src/org/bimserver/geometry/Vector.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public static float[] minus(float[] u, float[] v){
public static float[] addition(float[] u, float[] v){
return new float[]{u[X]+v[X],u[Y]+v[Y],u[Z]+v[Z]};
}
public static double[] addition(double[] u, double[] v){
return new double[]{u[X]+v[X],u[Y]+v[Y],u[Z]+v[Z]};
}
public static void addition(double[] output, double[] u, double[] v){
output[X] = u[X]+v[X];
output[Y] = u[Y]+v[Y];
output[Z] = u[Z]+v[Z];
}
public static double[] subtract(double[] u, double[] v){
return new double[]{u[X]-v[X],u[Y]-v[Y],u[Z]-v[Z], 1};
}
Expand All @@ -61,6 +69,10 @@ public static float[] scalarProduct(float r, float[] u){
return new float[]{u[X]*r,u[Y]*r,u[Z]*r};
}
//scalar product
public static float[] scalarProduct2(float r, float[] u){
return new float[]{u[X]*r,u[Y]*r};
}
//scalar product
public static double[] scalarProduct(double r, double[] u){
return new double[]{u[X]*r,u[Y]*r,u[Z]*r};
}
Expand Down

0 comments on commit 85e4688

Please sign in to comment.