summaryrefslogtreecommitdiff
path: root/nc_files/ngcgui_lib/utilitysubs/move.ngc
blob: 3e09d51ba9a298f08e5abfb939a96b3ff53e7fb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(return: _move:x,y,len,phi,cos,sin)
o<move>  sub
(not_a_subfile)
#<x>       = #1
#<y>       = #2
#<rotate>  = #3 (=0 degrees)
#<scale>   = #4 (=1)
#<xoff>    = #5 (=0 after rotation)
#<yoff>    = #6 (=0 after rotation)

o<if1>  if [0]
          (for offsetting before rotation)
          #<x> = [#<x> + #<xpre>]
          #<y> = [#<y> + #<ypre>]
o<if1>  endif

        o<line>  call [0][0][#<x>][#<y>]
        #<len>   = #<_line:len>
        #<phi>   = #<_line:phi>
        #<cos>   = #<_line:cos>
        #<sin>   = #<_line:sin>

        #<x> = [#<xoff> + #<scale> * #<len> * COS[#<rotate> + #<phi>]]
        #<y> = [#<yoff> + #<scale> * #<len> * SIN[#<rotate> + #<phi>]]

o<line> call [0][0][#<x>][#<y>]
        #<_move:len>   = #<_line:len>
        #<_move:phi>   = #<_line:phi>
        #<_move:cos>   = #<_line:cos>
        #<_move:sin>   = #<_line:sin>
        #<_move:x>     = #<x>
        #<_move:y>     = #<y>

o<move> endsub