forsyth: (DotDotDot)
2009-07-17 06:36 pm
Entry tags:

Math/Programming Time! (with questions!)

Okay, here's a mat puzzle for you, folks. I'm trying to create a 3d angled sloped wedge. With for loops, on a 3d X,Y,H grid.

The base is a triangle, I know it's a right triangle. I know the length and the height of it. I know the angle at one tip. The wedge is also a right triangle, (well, until I cut off the top at a specified height, but that's just a matter of a simple if H(i,j) > hc, H(i,j)=hc statement) and I know the angle of that slope too.

I want to find the X,Y coordinates of the hypotenuse every step along the length. Well, the X coordinate, since I'm counting along the Y axis. Once I have that, I should be able to increment from that, to the back of the triangle, and calculate the height at each step along there, which should be easy. Famous last words. There's a picture in the cut below

Trig and Code, yay! )

So yeah, any help anybody can offer would be great.