3d-dart/server/system/NAfunctionLib.py
def rmatrix(alpha, beta, gamma):
    
	"""Return a rotation matrix based on the Euler angles alpha,beta, and gamma in radians."""

	cosA = math.cos(alpha)
	cosB = math.cos(beta)
	cosG = math.cos(gamma)

	sinA = math.sin(alpha)
	sinB = math.sin(beta)
	sinG = math.sin(gamma)

	R = array(
            [[cosB*cosG, cosG*sinA*sinB-cosA*sinG, cosA*cosG*sinB+sinA*sinG],
             [cosB*sinG, cosA*cosG+sinA*sinB*sinG, cosA*sinB*sinG-cosG*sinA ],
             [-sinB,     cosB*sinA,                cosA*cosB ]], float)

	assert numpy.allclose(numpy.linalg.determinant(R), 1.0)
	
	return R
Return a rotation matrix based on the Euler angles alpha,beta, and gamma in radians.
Return a rotation matrix based on the Euler angles alpha,beta, and gamma in radians.
Return a rotation matrix based on the Euler angles alpha beta and gamma in radians .
def rmatrix(alpha, beta, gamma):
	cosA = math.cos(alpha)
	cosB = math.cos(beta)
	cosG = math.cos(gamma)
	sinA = math.sin(alpha)
	sinB = math.sin(beta)
	sinG = math.sin(gamma)
	R = array(
            [[cosB*cosG, cosG*sinA*sinB-cosA*sinG, cosA*cosG*sinB+sinA*sinG],
             [cosB*sinG, cosA*cosG+sinA*sinB*sinG, cosA*sinB*sinG-cosG*sinA ],
             [-sinB,     cosB*sinA,                cosA*cosB ]], float)
	assert numpy.allclose(numpy.linalg.determinant(R), 1.0)
	return R
def rmatrix ( alpha , beta , gamma ) : cosA = math . cos ( alpha ) cosB = math . cos ( beta ) cosG = math . cos ( gamma ) sinA = math . sin ( alpha ) sinB = math . sin ( beta ) sinG = math . sin ( gamma ) R = array ( [ [ cosB * cosG , cosG * sinA * sinB - cosA * sinG , cosA * cosG * sinB + sinA * sinG ] , [ cosB * sinG , cosA * cosG + sinA * sinB * sinG , cosA * sinB * sinG - cosG * sinA ] , [ - sinB , cosB * sinA , cosA * cosB ] ] , float ) assert numpy . allclose ( numpy . linalg . determinant ( R ) , 1.0 ) return R
Return a rotation matrix based on the Euler angles alpha,beta, and gamma in radians.
Return a rotation matrix based on the Euler angles alpha beta and gamma in radians .
"""Return a rotation matrix based on the Euler angles alpha,beta, and gamma in radians."""
alpha
beta
gamma