Exemple #1
0
    def OPQ(self):
        O = vctr.array2vec(self.array[0:3])
        OR0 = vctr.array2vec([0, 0, np.sqrt(0.75) * self.l])
        OR1 = qtrn.RotOper(self.Phi, vctr.Vector(0, 1, 0), OR0)
        OR2 = qtrn.RotOper(self.Theta, vctr.Vector(0, 0, 1), OR1.purify())

        R = vctr.Add(O, OR2)
        OR0.contents()
        OR1.purify().contents()
        OR2.purify().contents()
        R.contents()

        if self.Phi == 0:
            Pr = qtrn.RotOper(self.Theta, vctr.Vector(0, 0, 1),
                              vctr.Vector(0, 1, 0))
            PR0 = vctr.ScalarMul(0.5 * self.l, Pr.purify().unit())

        else:
            Pr = vctr.Cross(vctr.Vector(0, 0, 1), OR2.purify())
            PR0 = vctr.ScalarMul(0.5 * self.l, Pr.unit())

        PR = qtrn.RotOper(self.Psy, OR2.purify(), PR0)

        #PR0 = vctr.ScalarMul(0.5*self.l,Pr.unit())

        P = vctr.Add(R, PR.purify())
        Q = vctr.Subtract(R, PR.purify())

        p = np.round(P.array().reshape(1, 3), 8)
        o = np.round(O.array().reshape(1, 3), 8)
        q = np.round(Q.array().reshape(1, 3), 8)
        OP_Array = np.append(o, p, axis=0)
        OPQ_Array = np.append(OP_Array, q, axis=0)
        return OPQ_Array
Exemple #2
0
def RotateInSteps(Axis,delTheta,u1,v1):
    u2 = qtrn.RotOper(delTheta,Axis,u1).purify()
    v2 = qtrn.RotOper(delTheta,Axis,v1).purify()

    return u2,v2