Java Reference
In-Depth Information
x2, y2
B
a
c
C
x3, y3
A
b
x1, y1
(a) (b) (c)
F IGURE 18.35 (a-b) Exercise18.36 enables the user to drag vertices and display the angles dynamically. (c) Exercise18.37
enables the user to drag vertices and display the lines and their intersecting point dynamically.
**18.37
( Geometry: intersecting point ) Write a program that displays two line seg-
ments with their end points, and their intersecting point. Initially, the end
points are at ( 20 , 20 ) and ( 56 , 130 ) for line 1 and at ( 100 , 20 ) and ( 16 , 130 )
for line 2. The user can use the mouse to drag a point and dynamically display
the intersecting point, as shown in Figure 18.35c. Hint : See Programming
Exercise 3.25 for finding the intersecting point of two unbounded lines.
 
Search WWH ::




Custom Search