Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- P = 0
- D = 1
- W = 2
- #P D W
- length = [1, 1, 1]
- minValue = [10, 10, 10]
- maxValue = [30, 30, 30]
- increment = [10, 10, 10]
- for thetaP in range (minValue[P], maxValue[D], increment[W]):
- positionPx = length[P] * math.cos (thetaP * math.pi / 180)
- positionPy = length[P] * math.sin (thetaP * math.pi / 180)
- for thetaD in range (minValue[D], maxValue[D], increment[D]):
- positionDx = positionPx + length[D] * math.cos ((thetaP + thetaD) * math.pi / 180)
- positionDy = positionPy + length[D] * math.sin ((thetaP + thetaD) * math.pi / 180)
- for thetaW in range (minValue[W], maxValue[W], increment[W]):
- positionWx = positionDx + length[W] * math.cos ((thetaP + thetaD + thetaW) * math.pi / 180)
- positionWy = positionDy + length[W] * math.sin ((thetaP + thetaD + thetaW) * math.pi / 180)
- print ('positionPx', positionPx, 'positionPy', positionPy)
- print ('positionDx', positionDx, 'positionDy', positionDy)
- print ('positionWx', positionWx, 'positionWy', positionWy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement