-
Ternary diagram / ternary plot calculations
To all masters of expressions & math!
I’m trying to create a ternary diagram where a dot layer would have three slider controls in which all 3 percentage values would be calculated from the dot’s position on the diagram.
I already knew I wouldn’t be able to figure out how to do get this to properly work, so I tried to at least create something extremely simple which would help me in reading the diagram and guess working it and then enter the displayed values manually – so I’d fake it. But this didn’t work either, so I’m back at 0 and rethinking if I could maybe get it to work the way it should.
Is there someone who understands the math behind ternary diagrams and can fairly easily come up with the formula which I could put into 3 sliders to spit out the percentage?
Thanks a ton.
Just to let you know what I’ve been trying, here’s my fake guess work expression:
For the y axis I mapped my points on the composition to 0 and 100% by interpolating the y position into percentages which get updated when I move the dot. I put this expression into a slider to display the percentage:
y0 = 620;
y100 = 450;
yR = position[1];
Math.round((linear(yR, y0, y100,100,0))/5)*5
Did the same for the x axis but I soon realised this his nowhere close to even helping me guess the correct values for my dot 😉 so as I said, I will have to scratch all this.