How to calculate coordinates and line segments

301038-02.jpg

That should work like that.