Example #1
0
    while window.open:
        window.check()
        window.clear()
        window.draw.control()
        v1.rotate(0.1)
        v2 = v1 % (pi / 2)
        v2.color = GREEN
        v2.rotate(0.1)
        f2.rotate(0.1)
        center = f2.center()
        center.color = BLUE
        #center.radius=0.1
        A = v1(center)
        window.draw.show()
        center.show(window)
        v1.show(center, window)
        v2.show(A, window)
        f2.show(window)
        window.flip()
    #Segment(f[0],f[1],color=(255,0,0)).center().show(window)
    #print(p4 in f)
    #window.clear()
    #p4.show(window)
    #a=Line(p4,p2,color=(255,0,0))
    #b=Segment(p1,p3,color=(255,255,0))
    #a.show(window)
    #b.show(window)
    #p=b|a
    #window()
    #a=Vector(1,5)
Example #2
0
from myabstract import Form, Segment, Line, Vector, Point

from mysurface import Surface
surface = Surface(name="Test")

#line=Line.random()
#segment=Segment.random()
#print(line|segment)

import mycolors
import math

vector = Vector(1, 0)
point = Point(0, 0)

while surface.open:
    surface.check()
    surface.control()
    surface.clear()
    surface.show()
    vector.rotate(0.1)
    a = vector.angle
    wl = mycolors.bijection(a, [-math.pi, math.pi], [380, 780])
    c = mycolors.setFromWavelength(wl)
    vector.show(surface, point, color=c)
    surface.console("angle: ", str(a), nmax=20)
    #surface.print('something',(10,10),size=100,conversion=False)
    surface.flip()