Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_direction_live(dims){
- dim = dims.split("M");
- dim1 = dim[1].split(new RegExp('[\-\,]', 'g'));
- dim2 = dim[2].split(new RegExp('[\-\,]', 'g'));
- if(dim2[0] > dim1[0] && dim2[1] < dim1[1]){
- return "0";
- } else if(dim2[0] > dim1[0] && dim2[1] > dim1[1]){
- return "90";
- } else if(dim2[0] < dim1[0] && dim2[1] > dim1[1]){
- return "180";
- } else if(dim2[0] < dim1[0] && dim2[1] < dim1[1]){
- return "270";
- } else {
- return "0";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement