TO 坐标轴 :a :x :y :x数 :y数 :kx :ky :p
//:a缩放比例:x :y标注线密度:x数 :y数数字标注的密度 :k网格线的密度
//:p PI相关(p取值 0为无PI 1为x轴PI相关 2为y轴PI相关 3为全部PI相关)
hm
make :penx=-1500 :penw=2
setxy 1500 0
make :penx=0 :peny=-750
setxy 0 750
hm
for ::I :a*:x 1500
make :penx=::I
fd 6
bk 6
]:a*:x
for ::I :a*:x*(-1) -1500
make :penx=::I
fd 6
bk 6
]:a*:x*(-1)
hm
rt 90
for ::I :a*:y 750
make :peny=::I
fd 6
bk 6
]:a*:y
for ::I :a*:y*(-1) -750
make :peny=::I
fd 6
bk 6
]:a*:y*(-1)
hm
make :peny=-7
//↓▼↓▼↓▼↓▼↓▼↓▼↓PI相关有所不同▼↓▼↓▼↓▼↓▼↓▼↓▼
for ::I :a*:x数 1500
make :penx=::I-5
IF OR :p=1 :p=3
text 14 0 15 宋体 {(round(1000*(::I/:a)/PI))/1000}π
]
elif 1=1
text 14 0 15 宋体 {::I/:a}
]
]:a*:x数
for ::I :a*:x数*(-1) -1500
make :penx=::I-6
IF OR :p=1 :p=3
text 14 0 15 宋体 {(round(1000*(::I/:a)/PI))/1000}π
]
elif 1=1
text 14 0 15 宋体 {::I/:a}
]
]:a*:x数*(-1)
make :penx=6
for ::I :a*:y数 750
make :peny=::I+8
IF OR :p=2 :p=3
text 14 0 15 宋体 {(round(1000*(::I/:a)/PI))/1000}π
]
elif 1=1
text 14 0 15 宋体 {::I/:a}
]
]:a*:y数
for ::I :a*:y数*(-1) -750
make :peny=::I+8
IF OR :p=2 :p=3
text 14 0 15 宋体 {(round(1000*(::I/:a)/PI))/1000}π
]
elif 1=1
text 14 0 15 宋体 {::I/:a}
]
]:a*:y数*(-1)
//↑▲↑▲↑▲↑▲↑▲↑▲PI相关有所不同↑▲↑▲↑▲↑▲↑▲↑▲↑▲↑▲
hm
make :peny=-7
text 14 0 15 宋体 O
make :penw=1 :pena=200
hm
make :peny=-750
for ::I :a*:kx 1500
make :penx=::I
setxy :penx 750
make :peny=-750
]:a*:kx
for ::I :a*:kx*(-1) -1500
make :penx=::I
setxy :penx 750
make :peny=-750
]:a*:kx*(-1)
make :penx=-1500
for ::I :a*:ky 750
make :peny=::I
setxy 1500 :peny
make :penx=-1500
]:a*:ky
for ::I :a*:ky*(-1) -750
make :peny=::I
setxy 1500 :peny
make :penx=-1500
]:a*:ky*(-1)
make :pena=255
hm
TO 正弦图像 :x :y :z :k :a :b :j
//:x :y :z 置坐标旋转:k值域 :a缩放,:j精度(步长越小越精确):b为y轴方向的放大倍数
make :penx=((-1)*:b*(sin(((-1)*:k)))*(sin(deg(:z)))-:k*(cos(deg(:z)))+:x)*:a
make :peny=(:b*(sin(((-1)*:k)))*(cos(deg(:z)))-:k*(sin(deg(:z)))+:y)*:a
FOR ::j ((-1)*:k) :k
setxy ((-1)*:b*(sin(::j))*(sin(deg(:z)))+::j*(cos(deg(:z)))+:x)*:a (:b*(sin(::j))*(cos(deg(:z)))+::j*(sin(deg(:z)))+:y)*:a
]:j
TO 余弦图像 :x :y :z :k :a :b :j
//:x :y :z 置坐标旋转:k值域 :a缩放,:j精度(步长越小越精确):b为y轴方向的放大倍数
make :penx=((-1)*:b*(cos(((-1)*:k)))*(sin(deg(:z)))-:k*(cos(deg(:z)))+:x)*:a
make :peny=(:b*(cos(((-1)*:k)))*(cos(deg(:z)))-:k*(sin(deg(:z)))+:y)*:a
FOR ::j ((-1)*:k) :k
setxy ((-1)*:b*(cos(::j))*(sin(deg(:z)))+::j*(cos(deg(:z)))+:x)*:a (:b*(cos(::j))*(cos(deg(:z)))+::j*(sin(deg(:z)))+:y)*:a
]:j
TO 正切图像 :x :y :z :k :a :b :j
//:x :y :z 置坐标旋转:k值域 :a缩放,:j精度(步长越小越精确):b为y轴方向的放大倍数
if tan(:k)>:a*500
make :k=:k-:j
]
make :penx=((-1)*:b*(tan(((-1)*:k)))*(sin(deg(:z)))-:k*(cos(deg(:z)))+:x)*:a
make :peny=(:b*(tan(((-1)*:k)))*(cos(deg(:z)))-:k*(sin(deg(:z)))+:y)*:a
FOR ::j ((-1)*:k) :k
if tan(::j)>tan(::j+:j)
make :PENx=((-1)*:b*(tan(::j+:j))*(sin(deg(:z)))+::j*(cos(deg(:z)))+:x)*:a :PENy=(:b*(tan(::j+:j))*(cos(deg(:z)))+::j*(sin(deg(:z)))+:y)*:a
]
if tan(::j)<tan(::j+:j)
setxy ((-1)*:b*(tan(::j))*(sin(deg(:z)))+::j*(cos(deg(:z)))+:x)*:a (:b*(tan(::j))*(cos(deg(:z)))+::j*(sin(deg(:z)))+:y)*:a
]
]:j
//fplot /zoom 30 30 /plot x sin(x) /plot x 1/sin(x+pi/6) /plot x sin(x+2*pi/6)
TO MAIN
//text 32 0 15 宋体 同志们好!
正切图像 0 0 0 10 80 1 0.01
正弦图像 0 0 0 10 80 1 0.01
余弦图像 0 0 0 10 80 1 0.01
//make x_x (X-0x)*cz-(Y-Oy)*sz+Ox
//make y_y (X-0x)*sz+(Y-Oy)*cz+Oy
坐标轴 80 0.5*PI 1 0.5*PI 1 0.5*PI 1 1