@greengeek
This thing is getting sophisticated
Some debug comments at the end should be commented out or removed to avoid bash errors.
I think you can simplify some computations.
ACTUALDEGREE1=$(bc <<< "scale=2;$RAWRESULT1+180")
is the same as the faster
ACTUALDEGREE1=$((RAWRESULT1+180))
since you earlier converted RAWRESULT1 to integer
MODINTERNALANGLE=`sed "s/-//g"<<<$INTERNALANGLE`
can be handled faster by bash:
MODINTERNALANGLE=${INTERNALANGLE/-}
In some cases I get unexpected results. for example in case of your screenshot (Concave_Lens.jpg). When I start with the lower line (clicking 3 and 4) and then click 1 and 2 the result is about 333 degrees, i.e. the external angle.