Hi,
I have an image of an equilateral triangle, where the base of the triangle meets the base of the image perfectly. The image itself is square.
I need to be able to dynamically plot out points as an overlay on the image, as though plotting a ternary plot graph.
Obviously, the image is a square that uses cartesian co-ordinates. If I know that one corner of the triangle is at (0,0), and the other corner is at (320,0), I should be able to plot the points.
E.g. Assuming the length of a side of the triangle (320px) represents 100%, a point could be found at (44%, 8%, 48%).
Unfortunately I do not understand the explanation on Wikipedia well enough to know the math calc I should use for this (would have helped if there was a good example).
Can anybody explain this, or link me to a good example?
Regards,
Rob.
I have an image of an equilateral triangle, where the base of the triangle meets the base of the image perfectly. The image itself is square.
I need to be able to dynamically plot out points as an overlay on the image, as though plotting a ternary plot graph.
Obviously, the image is a square that uses cartesian co-ordinates. If I know that one corner of the triangle is at (0,0), and the other corner is at (320,0), I should be able to plot the points.
E.g. Assuming the length of a side of the triangle (320px) represents 100%, a point could be found at (44%, 8%, 48%).
Unfortunately I do not understand the explanation on Wikipedia well enough to know the math calc I should use for this (would have helped if there was a good example).
Can anybody explain this, or link me to a good example?
Regards,
Rob.