to y圆1 r a b home ;圆心在(a,b)上 new make e pid make c 2*r make d -1*r REPEAT c[dot d sqrt (r*r-d*d) dot d (sqrt (r*r-d*d))*(-1) make d d+1] make c 2*r make d -1*r REPEAT c[dot sqrt (r*r-d*d) d dot (sqrt (r*r-d*d))*(-1) d make d d+1] pu psxy e a b pd end to t椭圆 a b ;a,b为长短半轴(是半轴不是整轴) home make c 2*a make d -1*a REPEAT c[dot d (sqrt (1-(d*d)/(a*a)))*b dot d (sqrt (1-(d*d)/(a*a)))*b*(-1) make d d+1] make c 2*b make d -1*b REPEAT c[dot (sqrt (1-(d*d)/(b*b)))*a d dot (sqrt (1-(d*d)/(b*b)))*a*(-1) d make d d+1] end ;c*c=a*a-b*b ;(必须是a>b) ;c是焦点距离的一半 ;焦点到椭圆的距离之和是(a+c)+(a-c)=2a to t椭圆1 c a ;c焦半距a为到两焦点距离和的一半 home make e 2*a make d -1*a if a>c then make b sqrt(a*a-c*c) if a<c then make b sqrt(a*a+c*c) REPEAT e[dot d (sqrt (1-(d*d)/(a*a)))*b dot d (sqrt (1-(d*d)/(a*a)))*b*(-1) make d d+1] make e 2*b make d -1*b REPEAT e[dot (sqrt (1-(d*d)/(b*b)))*a d dot (sqrt (1-(d*d)/(b*b)))*a*(-1) d make d d+1] end
to y圆 r home;统一坐标系 ;画圆 make c 2*r make d -1*r REPEAT c[dot d sqrt (r*r-d*d) dot d (sqrt (r*r-d*d))*(-1) make d d+1] make c 2*r make d -1*r REPEAT c[dot sqrt (r*r-d*d) d dot (sqrt (r*r-d*d))*(-1) d make d d+1] end
;准圆方程 x^2+y^2=a^2+b^2 ;从准圆上任一点向椭圆引两条切线,这两条切线垂直。 to z准圆 a b ;a,b椭圆为长短半轴 home;统一坐标系 make r sqrt(a*a+b*b) make c 2*r make d -1*r ;画圆 REPEAT c[dot d sqrt (r*r-d*d) dot d (sqrt (r*r-d*d))*(-1) make d d+1] make c 2*r make d -1*r REPEAT c[dot sqrt (r*r-d*d) d dot (sqrt (r*r-d*d))*(-1) d make d d+1] end
;一次函数y=kx+b ;只画x-650到650,,,,,y-350到350 to z直线 k b home make c 1300 make d -650 REPEAT c[dot d k*d+b make d d+1] make c 700 make d -350 REPEAT c[dot (d-b)/k d make d d+1 end
;一元二次函数 ;y=ax^2+bx+c(a≠0 abc为常数) ;顶点坐标(-b/2a,(4ac-b^2)/4a)定值域的 to p抛物线 a b c home make e 1300 make d -650 REPEAT e[dot d a*d*d+b*d+c make d d+1] if a>0 then[make e 350-(4*a*c-b*b)/(4*a)] if a<0 then[make e 350+(4*a*c-b*b)/(4*a)] make d ((4*a*c-b*b)/(4*a)) ;if a>0 then[REPEAT e[dot ((-1)*b+sqrt(b*b-(4*a)*(c-d))/(2*a) d dot ((-1)*b-sqrt(b*b-(4*a)*(c-d))/(2*a) d make d d+1]] ;if a<0 then[REPEAT e[dot ((-1)*b+sqrt(b*b-(4*a)*(c-d))/(2*a) d dot ((-1)*b-sqrt(b*b-(4*a)*(c-d))/(2*a) d make d d-1]] if a>0 then[REPEAT e[make f sqrt(d/a+(b*b-4*a*c)/(4*a*a)) dot f-b/(2*a) d dot f*(-1)-b/(2*a) d make d d+1]] if a<0 then[REPEAT e[make f sqrt(d/a+(b*b-4*a*c)/(4*a*a)) dot f-b/(2*a) d dot f*(-1)-b/(2*a) d make d d-1]] end