drawing isoscele triangle

closed account (E3h7X9L8)
I have a problem, I have to draw a isoscele triangle inside a 2D array of any size n rows, m colums, that would fill the array completly, the peak of the triangle must be in the position [0][m/2]

The biggest problem I encountered is how do I calculate the slope of the two sides of the triangle ?
Slope = rise/run = n rows / (m/2) columns
closed account (E3h7X9L8)
well can you explain ? I want to calculate all the points of the slope not just one

i want to get something like this:

__________*__________
_________***_________
________*****________
_______*******_______
______*********______
______*********______
_____***********_____
____*************____
___***************___
__*****************__
__*****************__
_*******************_
*********************
Last edited on
Topic archived. No new replies allowed.