| |
|
|
p.specht
| at that building possible kompakter gear diving sometimes the angesprochene trouble on. with us here's it at least a nice geometrische Spielerei.
Windowtitle "Kreis, definiert through two spots and a Tangente"
'(CL) Copyleft P.woodpecker@gmx.at, No however geartete Gewähr!
'xm=-(sin(a)*sqr(y2)-2*sin(a)*y1*y2-2*cos(a)*x1*y2+sin(a)*sqr(y1)+2*cos(a)*x1*y1\
'+sin(a)*sqr(x2)-sin(a)*sqr(x1))/(2*(cos(a)*y2-cos(a)*y1-sin(a)*x2+sin(a)*x1))
'ym=1/tan(a)*(x1-xm)+y1 : r=sqrt(sqr(x1-xm)+sqr(y1-ym))
Windowstyle 24:window (%maxx-680)/2,0-680,%maxy-40
declare xm!,a!,sa!,y2!,y1!,x1!,ca!,x2!,ym!,xh!,yh!,dx!,dy!,ta!,r!
declare mausx&,mausy&:UseFont "Arial",15,9,1,0,0
Textcolor rgb(0,0,0),-1:usebrush 0,rgb(255,255,255)
x1!=150:y1!=150'P1
a!=-10/180*pi()'absolute Tangentenwinkel
x2!=400:y2!=300'P2
xh!=(x1!+x2!)/2:yh!=(y1!+y2!)/2
lup:
xm!=-(sin(a!)*sqr(y2!)-2*sin(a!)*y1!*y2!-2*cos(a!)*x1!*y2!+sin(a!)*sqr(y1!)+2*cos(a!)*x1!*y1!\
+sin(a!)*sqr(x2!)-sin(a!)*sqr(x1!))/(2*(cos(a!)*y2!-cos(a!)*y1!-sin(a!)*x2!+sin(a!)*x1!))
case a!<>0:ym!=cos(a!)/sin(a!)*(x1!-xm!)+y1!
r!=sqrt(sqr(x1!-xm!)+sqr(y1!-ym!))
cls
print "Kreis, definiert through two spots and a Tangente"
usepen 0,3,rgb(255,0,0)
ellipsis xm!+r!,ym!+r! - xm!-r!,ym!-r!
usepen 0,11,255:line x1!,y1!-x1!+1,y1!:line x2!,y2!-x2!+1,y2!:line xm!,ym! - xm!+1,ym!
usepen 0,8,0:line xh!,yh! - xh!+1,yh!
usepen 1,1,0:line x1!,y1! - x2!,y2!
usepen 1,1,rgb(0,0,255):line xh!,yh! - xm!,ym!:line x1!,y1! - xm!,ym!
usepen 2,1,rgb(0,0,255):line mausx&,mausy&-x1!,y1!
drawtext x1!,y1!-22,"P1":drawtext x2!,y2!-22,"P2"
drawtext xh!,yh!-22,"H":drawtext xm!,ym!-22,"M"
waitinput 333:mausx&=%mousex:mausy&=%mousey:a!=0
case mausx&-x1!:a!=arctan((mausy&-y1!)/(mausx&-x1!))
goto "lup"
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/29/21 ▲ |
|
|
|