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