上QQ阅读APP看书,第一时间看更新
28. Arrowheads
Write a program that lets the user click and drag to define a line segment. Add a tail to the segment's starting point and an arrowhead to its ending point, as shown in the following screenshot:
Hint: If <vx, vy> is a vector, then <vy, -vx> and <-vy, vx> are two vectors perpendicular to the original vector.