This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Bit of a noob so sorry if i'm not descriptive enough.
Im trying to use python to calculate the average cross sectional area of a rectangular prism given coordinate points. My logic was that id increment pitch,roll, and yaw in a nested for loop trio and take the convex hull each time as the area. Then add em up, divide by the number of times i did this. Considering this is a 20 by 30 by 10 rectangular prism, I expected an answer in the 300s ish with all numbers being between 200-600.
This was the general rotation stuff I did:
while step < 8:
#x axis rotation axis
y[step] = y[step] * math.cos(0.0174533) z[step] * math.sin(0.0174533)
z[step] = z[step] * math.cos(0.0174533) - y[step] * math.sin(0.0174533)
step = step 1
step = 0
then y
x[step] = x[step] * math.cos(0.0174533) - z[step] * math.sin(0.0174533)
z[step] = z[step] * math.cos(0.0174533) x[step] * math.sin(0.0174533)
then z
y[step] = y[step] * math.cos(0.0174533) x[step] * math.sin(0.0174533)
x[step] = x[step] * math.cos(0.0174533) y[step] * math.sin(0.0174533)
lets just say that didn't happen. In my original attempt I was getting numbers as low as 100 and now they've only gotten lower after fixing angles. any idea which i could be messing up? Ill send all the code need be but i guess question 1 is does this bit look right at all.
Edit: code https://repl.it/@AlexisisVerbaro/StrikingInternalFolder
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/programming...