Arama butonu
Bu konudaki kullanıcılar: 1 misafir
7
Cevap
2488
Tıklama
0
Öne Çıkarma
Ne anlıyorsunuz(Java)
H
15 yıl (1384 mesaj)
Binbaşı
Konu Sahibi

"Create a line class having slope and intercept as instance variables.That is the line should be represented internally with its slope and inrercept.

Write four constructors for initilizing line objects as follows
o Taking two points
o Slope and intercept
o Slope and a point
o Three real numbers a,b,c for the line a*x+b*y –c = 0
as parameters
Add any relevant get and set methods
Add a method called intersectLine when invoked on a line object and takes a second line object as parameters and calculate and returns the intersection point of the two lines as a point object. If the two lines are parallel or coinside the method will return null.
Add a method called intersectPoint when invoked on a line object and takes a point object as parameters and calculate and returns the intersection point of the line and the point Find the equation of the perpendicular line from the point to the line and invoke the intersectLine method to find the intersctions of the two lines.
Add a method called distance when invoked on a line object and takes a point object as parameters and calculate the distance between a point and a line. Thsi method should utilize the intersectPoint method of the line class as well as the distance method of the Point class.
Add a displayLine methd which will display the line like that:
y= slope*x + intercept Example y=3x+2


Create a test class to perform the following
o Get x and y coordinates of a point from the user and create a Point object
o Get two lines from the user Each time show the menu for entering four options of entering the line as follows:
§ 1-Asking two points
§ 2-Asking a point and slope
§ 3- Asking slope and intercept
§ 4- Asking a,b and c
o Find the intersection of the point and the two lines. Print the results to the screen.
o Find the distance between the point and the two lines. Print the result to the screen.
o Find the intersection of the two ines. Print the result to the screen "



Yazılanları ödevim olarak yapmam gerek fakat matematiğim pek iyi olmadığından oop' gede yeni başladığımdan tam olarak nasıl bir yol izleyeceğimi bilemedim. Biri kısaca açıklayabilir mi ?
ben şunu anladım: kullanıcıdan 2 nokta , 1 tane nokta ve eğri, 1 tane daha eğri ve intercept(?), 3 tane a,b,c sayısı istiycem. 2 eğrinin kesişim noktaları, 1 noktayla eğri arasındaki uzaklık, 1 nokta ve doğrunun kesişimi bunları ekrana yazdırcam fakat eğrilerin nasıl denklemini yazıcağımı anlıyamadım..