83b. Find area between 3 points which form a triangle.
Invoke function using 3 arguments of pair of coordination.
Nth arg (array) .... pair of coordination e.g. [1, 2]
from original triangle pqr:
. p ^
^ ***___ |
^ ***___ | p[1]-r[1]
^ ***___ r |
^ s ._____. v
^ | / ^
^ | / |
^ | / | b
^ | / |
^ |/ |
. q v
<------------------> <---->
q[0]-p[0] a
cut form p to s, and transform it into this:
. p p". ^
| \ |
| \ | p[1]-r[1]
p' s | \ r |
.___________________._____. v
^ | / ^
^ | / |
^ | / | b
^ | / |
^ |/ |
. q v
<------------------> <---->
q[0]-p[0] a
now, there are three triangle (qsr, qsp', rsp"); or, for this hack, two triangle (large: rqp', small: rsp"), which calculate much easier!
@maettig 95b -> 93b -> 83b
Interesting Maths, and it seems it cannot be shortened any more (maybe Maths trick can).
But I don't quite understand how to transform from the original triangle into the three triangles, can you explain more?