im currently working on visualization of an evaporation experiment. I've plotted a ternary phase diagram (NaCl-Na2SO4-H2O) with ggtern and data based on phreeqc simulation. Phase boundaries (red/blue) are smoothed data points (geom_smooth_tern).
> geom_smooth_tern(data=dataTernNaCl, aes(x=NaCl, y=H2O, z=Na2SO4), method = loess, se = FALSE, color = "blue")
#Dataframe
> select(dataTernNaCl, NaCl, Na2SO4, H2O)[324:329,]
# A tibble: 6 x 3
NaCl Na2SO4 H2O
<dbl> <dbl> <dbl>
1 0.2503361 0.03098092 0.7186830
2 0.2502058 0.03123192 0.7185623
3 0.2500746 0.03148678 0.7184386
4 0.2499421 0.03174650 0.7183114
5 0.2498056 0.03201021 0.7181842
6 0.2496680 0.03227777 0.7180542
Given that phase diagram, I want to visualize the evaporation path (reduction of H2O) from a certain point P1 (based on experimental data).
Straight reduction of H2O is perfectly describable as a line between 2 points. Im using geom_segment.
I need to find the intersection of the evaporation line with the phase boundaries to finally draw the line from P1 to the point of intersection.
Greetings, Christian