Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function get_direction_live(dims){
  2. dim = dims.split("M");
  3. dim1 = dim[1].split(new RegExp('[\-\,]', 'g'));
  4. dim2 = dim[2].split(new RegExp('[\-\,]', 'g'));
  5. if(dim2[0] > dim1[0] && dim2[1] < dim1[1]){
  6. return "0";
  7. } else if(dim2[0] > dim1[0] && dim2[1] > dim1[1]){
  8. return "90";
  9. } else if(dim2[0] < dim1[0] && dim2[1] > dim1[1]){
  10. return "180";
  11. } else if(dim2[0] < dim1[0] && dim2[1] < dim1[1]){
  12. return "270";
  13. } else {
  14. return "0";
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement