Ejemplo n.º 1
0
def getCumulativeVector3Remove(prefix, vector3, xmlElement):
    "Get cumulative vector3 and delete the prefixed attributes."
    cumulativeVector3 = evaluate.getVector3RemoveByPrefix(
        prefix + 'rectangular', vector3, xmlElement)
    cylindrical = evaluate.getVector3RemoveByPrefix(prefix + 'cylindrical',
                                                    Vector3(), xmlElement)
    if not cylindrical.getIsDefault():
        cylindricalComplex = euclidean.getWiddershinsUnitPolar(
            math.radians(cylindrical.y)) * cylindrical.x
        cumulativeVector3 += Vector3(cylindricalComplex.real,
                                     cylindricalComplex.imag, cylindrical.z)
    polar = evaluate.getVector3RemoveByPrefix(prefix + 'polar', Vector3(),
                                              xmlElement)
    if not polar.getIsDefault():
        polarComplex = euclidean.getWiddershinsUnitPolar(math.radians(
            polar.y)) * polar.x
        cumulativeVector3 += Vector3(polarComplex.real, polarComplex.imag)
    spherical = evaluate.getVector3RemoveByPrefix(prefix + 'spherical',
                                                  Vector3(), xmlElement)
    if not spherical.getIsDefault():
        radius = spherical.x
        elevationComplex = euclidean.getWiddershinsUnitPolar(
            math.radians(spherical.z)) * radius
        azimuthComplex = euclidean.getWiddershinsUnitPolar(
            math.radians(spherical.y)) * elevationComplex.real
        cumulativeVector3 += Vector3(azimuthComplex.real, azimuthComplex.imag,
                                     elevationComplex.imag)
    return cumulativeVector3
Ejemplo n.º 2
0
def getCumulativeVector3Remove(prefix, vector3, xmlElement):
	"Get cumulative vector3 and delete the prefixed attributes."
	cumulativeVector3 = evaluate.getVector3RemoveByPrefix(prefix + 'rectangular', vector3, xmlElement)
	cylindrical = evaluate.getVector3RemoveByPrefix(prefix + 'cylindrical', Vector3(), xmlElement)
	if not cylindrical.getIsDefault():
		cylindricalComplex = euclidean.getWiddershinsUnitPolar(math.radians(cylindrical.y)) * cylindrical.x
		cumulativeVector3 += Vector3(cylindricalComplex.real, cylindricalComplex.imag, cylindrical.z)
	polar = evaluate.getVector3RemoveByPrefix(prefix + 'polar', Vector3(), xmlElement)
	if not polar.getIsDefault():
		polarComplex = euclidean.getWiddershinsUnitPolar(math.radians(polar.y)) * polar.x
		cumulativeVector3 += Vector3(polarComplex.real, polarComplex.imag)
	spherical = evaluate.getVector3RemoveByPrefix(prefix + 'spherical', Vector3(), xmlElement)
	if not spherical.getIsDefault():
		radius = spherical.x
		elevationComplex = euclidean.getWiddershinsUnitPolar(math.radians(spherical.z)) * radius
		azimuthComplex = euclidean.getWiddershinsUnitPolar(math.radians(spherical.y)) * elevationComplex.real
		cumulativeVector3 += Vector3(azimuthComplex.real, azimuthComplex.imag, elevationComplex.imag)
	return cumulativeVector3