Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/06/2019 in all areas

  1. you are welcome! it was typo, glad you got it sorted by yourself FYI system variable default should be angdir=0 angbase=0.0 p/s: i slightly optimized (angltof '(ddd mm ss)) to (dmstof ddd mm ss)
    1 point
  2. EXCEL data in 2D try this sub - rectangular to polar coordinates (defun r->p (v / a) ; v (x,y) ;2D Rectangular -> polar coordinates - hanhphuc (list (if (minusp (setq a (apply 'atan (reverse v)))) (+ a pi pi) a ) (sqrt (apply '+ (mapcar '* v v))) ) ) ; angle & distance ;;;(rtd (car (r->p '(4 -3)))) ;;;126.87 ;;;(r->p '(1.0 1.0)) ;(0.785398 1.41421) ;;;(angtos (car (r->p '(3 4))) 1 4) ;"53d7'48\"" (defun dmstof (d m s / l) ;hanhphuc (setq l (list d m s)) (if (vl-every ''((x) (and (<= 0. x) (< x 60.))) (cdr l)) ((if (minusp d) - + ) (angtof (apply 'strcat (mapcar ''((a b c) (strcat (rtos (abs a) 2 c) b)) l '("d" "'" "\"") '(0 0 2)) ) ) ) ) ) ;;;(dmstof -176 35 10.3) ;;;-3.08201 ;;;(setq str (getstring t "\nDDD MM SS : ") ) ;;;(apply 'dmstof (read (strcat "(" str ")"))) ;example from your EXCEL sheet (setq ; a ( angltof '(-176 35 10.3) ) a (dmstof -176 35 10.3) ;rotation ddd mm ss p ' ( 172.756 99.97) ; axis offset XY op ' (118.203 43.008) ; point#4= old coordinates XY ) ;usage: (defun foo (p a op) (apply 'polar (cons p (mapcar '+ (list a 0.0) (r->p op)) ) ) ) (foo p a op) (57.3237 49.9997) ;point#4= new coordinates XY
    1 point
  3. There is also THIS that Se7en put together.
    1 point
  4. Perhaps this thread on The Swamp can help https://www.theswamp.org/index.php?topic=54466.msg590071#msg590071
    1 point
×
×
  • Create New...