00001 package commandline.Algorithms;
00002
00003 public class CoordinateTransform {
00004
00005 public CoordinateTransform() {
00006 }
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 public static float[] nieuwecoordinaten(float a, float b,float c,float d,float x,float y){
00018
00019 double det=determinant(a,b,c,d);
00020 if(det==0){return null;}
00021 float nieuwe_x=(float)(1/det*(d*x-b*y));
00022 float nieuwe_y=(float)(1/det*(-c*x+a*y));
00023
00024 return new float[]{nieuwe_x,nieuwe_y};
00025
00026 }
00027
00028 public static double determinant(float a, float b,float c,float d){
00029 return a*d-b*c;
00030 }
00031
00032
00033 }