gcode support for offset arcs
This commit is contained in:
parent
cb6b32f982
commit
e21064bd86
6 changed files with 131 additions and 18 deletions
16
arc_algorithm/theta.rb
Normal file
16
arc_algorithm/theta.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
require 'pp'
|
||||
include Math
|
||||
|
||||
def calc_theta(x,y)
|
||||
theta = atan(1.0*x/y.abs)
|
||||
return(theta) if(y>0)
|
||||
if (theta>0)
|
||||
return(PI-theta)
|
||||
else
|
||||
return(-PI-theta)
|
||||
end
|
||||
end
|
||||
|
||||
(-180..180).each do |deg|
|
||||
pp [deg, calc_theta(sin(1.0*deg/180*PI), cos(1.0*deg/180*PI))/PI*180]
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue