|
SET WINDOW -10,10,-10,10 !表示領域
DRAW grid !座標を描く
CALL fvLINE(2,-6, 3,4) !1 y=2x-6
CALL fvLINE(-3/2,9, 0,4) !2 y=(-3/2)x+9
CALL fvLINEH(2, -5,4) !3 y=2
CALL fvLINE(-1/5,2, -5,0) !4 y=(-1/5)+2
CALL fvLINEH(0, -3,3) !5 y=0
CALL fvLINEV(0, 2,9) !6 x=0
CALL fvLINE(6/5,9, -5,0) !7 y=(6/5)x+9
CALL fvLINE(-1,-3, -5,-3) !8 y=-x-3
CALL fvLINEH(3, 0,4) !9 y=3
CALL fvLINE(2/3,-10, 6,9) !10 y=(2/3)x-10
CALL fvLINEH(-6, -9,-8) !11 y=-6
CALL fvLINEV(-3, -8,-4) !12 x=-3
CALL fvCIRCLE(6.5,4.5,0.5, -10,10) !13 (x+6.5)^2+(y+4.5)^2=0.5^2
CALL fvLINEV(1, -8,-4) !14 x=1
CALL fvLINEH(-6, -5,6) !15 y=-6
CALL fvLINEV(9, -8,-4) !16 x=9
CALL fvLINE(-2/3,-2, 6,9) !17 y=(-2/3)x-2
CALL fvLINEV(-1, -8,-4) !18 x=-1
CALL fvLINEV(-5, -10,-2) !19 x=-5
CALL fvCIRCLE(5,6,4, -9,-5) !20 (x+5)^2+(y+6)^2=4^2
END
EXTERNAL SUB fvLINE(A,B, P,Q) !直線y=Ax+B, x∈[P,Q]
PLOT LINES: P,A*P+B; Q,A*Q+B
END SUB
EXTERNAL SUB fvLINE2(A,B, P,Q) !直線y=Ax+B(A≠0), y∈[P,Q]
IF A=0 THEN
PRINT "直線y=Ax+BでA=0です。"; A;B; P;Q
STOP
ELSE
PLOT LINES: (P-B)/A,P; (Q-B)/A,Q
END IF
END SUB
EXTERNAL SUB fvLINEH(B, P,Q) !水平線y=B, x∈[P,Q]
PLOT LINES: P,B; Q,B
END SUB
EXTERNAL SUB fvLINEV(A, P,Q) !垂直線x=A, y∈[P,Q]
PLOT LINES: A,P; A,Q
END SUB
EXTERNAL SUB fvCIRCLE(A,B,R, P,Q) !円 (x+A)^2+(y+B)^2=R^2, x∈[P,Q] ※中心(-A,-B)、半径R
FOR x=P TO Q STEP 0.01 !上側
WHEN EXCEPTION IN
PLOT LINES: x,SQR(R^2-(x+A)^2)-B;
USE
PLOT LINES
END WHEN
NEXT x
PLOT LINES
FOR x=P TO Q STEP 0.01 !下側
WHEN EXCEPTION IN
PLOT LINES: x,-SQR(R^2-(x+A)^2)-B;
USE
PLOT LINES
END WHEN
NEXT x
PLOT LINES
END SUB
EXTERNAL SUB fvFNC2(A,B,C, P,Q) !2次関数y=A(x+B)^2+C, x∈[P,Q] ※軸x=-B、頂点(-B,C)
FOR x=P TO Q STEP 0.01
PLOT LINES: x,A*(x+B)^2+C;
NEXT x
PLOT LINES
END SUB
|
|