Exemplo n.º 1
0
    def calculateEndPerpendiculars(self, start, control0, control1, end):
        unitC00 = VectMath.unitvect(
            [control0[0] - start[0], control0[1] - start[1]])
        #unitControl00 = [self.startPos[0]+(10*unitC00[0]),self.startPos[1]+(10*unitC00[1])]
        perpUnitStartLeft = [
            start[0] + (10 * unitC00[1]), start[1] - (10 * unitC00[0])
        ]
        perpUnitStartRright = [
            start[0] - (10 * unitC00[1]), start[1] + (10 * unitC00[0])
        ]

        unitC01 = VectMath.unitvect(
            [control1[0] - end[0], control1[1] - end[1]])
        #unitControl01 = [self.endPos[0]+(10*unitC01[0]),self.endPos[1]+(10*unitC01[1])]
        perpUnitEndLeft = [
            end[0] - (10 * unitC01[1]), end[1] + (10 * unitC01[0])
        ]
        perpUnitEndRight = [
            end[0] + (10 * unitC01[1]), end[1] - (10 * unitC01[0])
        ]

        return [
            perpUnitStartLeft, perpUnitStartRright, perpUnitEndLeft,
            perpUnitEndRight
        ]
Exemplo n.º 2
0
    def calculateUnitPerpendiculars(self,start,control0,control1,end):
        unitC00 = VectMath.unitvect([control0[0]-start[0],control0[1]-start[1]])
        perpUnitStartLeft = [0+unitC00[1],0-unitC00[0]]
        perpUnitStartRright = [0-unitC00[1],0+unitC00[0]]

        unitC01 = VectMath.unitvect([control1[0]-end[0],control1[1]-end[1]])
        perpUnitEndLeft = [0-unitC01[1],0+unitC01[0]]
        perpUnitEndRight = [0+unitC01[1],0-unitC01[0]]

        return [perpUnitStartLeft,perpUnitStartRright,perpUnitEndLeft,perpUnitEndRight]
Exemplo n.º 3
0
def calculateEndPerpendiculars(start,control0,control1,end):
    unitC00 = VectMath.unitvect([control0[0]-start[0],control0[1]-start[1]])
    #unitControl00 = [self.startPos[0]+(10*unitC00[0]),self.startPos[1]+(10*unitC00[1])]
    perpUnitStartLeft = [start[0]+(10*unitC00[1]),start[1]-(10*unitC00[0])]
    perpUnitStartRright = [start[0]-(10*unitC00[1]),start[1]+(10*unitC00[0])]

    unitC01 = VectMath.unitvect([control1[0]-end[0],control1[1]-end[1]])
    #unitControl01 = [self.endPos[0]+(10*unitC01[0]),self.endPos[1]+(10*unitC01[1])]
    perpUnitEndLeft = [end[0]-(10*unitC01[1]),end[1]+(10*unitC01[0])]
    perpUnitEndRight = [end[0]+(10*unitC01[1]),end[1]-(10*unitC01[0])]

    return [perpUnitStartLeft,perpUnitStartRright,perpUnitEndLeft,perpUnitEndRight]
Exemplo n.º 4
0
    def calculateUnitPerpendiculars(self, start, control0, control1, end):
        unitC00 = VectMath.unitvect(
            [control0[0] - start[0], control0[1] - start[1]])
        perpUnitStartLeft = [0 + unitC00[1], 0 - unitC00[0]]
        perpUnitStartRright = [0 - unitC00[1], 0 + unitC00[0]]

        unitC01 = VectMath.unitvect(
            [control1[0] - end[0], control1[1] - end[1]])
        perpUnitEndLeft = [0 - unitC01[1], 0 + unitC01[0]]
        perpUnitEndRight = [0 + unitC01[1], 0 - unitC01[0]]

        return [
            perpUnitStartLeft, perpUnitStartRright, perpUnitEndLeft,
            perpUnitEndRight
        ]
Exemplo n.º 5
0
def calculatePerpendiculars(start,end):
    unit = VectMath.unitvect([end[0]-start[0],end[1]-start[1]])
    perpUnitStartLeft = [start[0]+(10*unit[1]),start[1]-(10*unit[0])]
    perpUnitStartRright = [start[0]-(10*unit[1]),start[1]+(10*unit[0])]

    perpUnitEndLeft = [end[0]+(10*unit[1]),end[1]-(10*unit[0])]
    perpUnitEndRight = [end[0]-(10*unit[1]),end[1]+(10*unit[0])]

    return [perpUnitStartLeft,perpUnitStartRright,perpUnitEndLeft,perpUnitEndRight]