java编写point类line类_编写一个线段类 MyLine,要求如下: 主要属性有: x ,y ;类型为Point (查看AP...

other.acadc16.svg

编写一个线段类 MyLine,要求如下:

主要属性有: x ,y ;类型为Point (查看AP

date.3402d68.svg 2016-08-23

download.d149a6d.svg 0

like.6b1b328.svg 0

collect.2156630.svg 0

暂无评分

classify.8d164f6.svg

其他

points_download.ebc3e32.svg 1

积分下载

question.bf77ac6.svg

如何获取积分?

编写一个线段类 MyLine,要求如下:

主要属性有: x ,y ;类型为Point (查看API)

编写构造方法,如 MyLine(Point p1 , Point p2)

编写5个成员方法。如:

检查线段是否位于第一象限check()…

求线段的长度 length() …

判断两条直线是否相交(另一线段作为参数)。

编写一点到该线段(或延长线)的距离

其他方法。

注:编写方法时,考虑利用Point类的方法

编写测试程序-Write a segment class MyLine, requirements are as follows: The main attributes are: x, y type Point (see API) the preparation of construction methods, such as MyLine (Point p1, Point p2) prepared by five members of the method. Such as: Check whether the line segment in the first quadrant check () ... order to segment the length of the length () ... to determine whether the two straight lines intersect (the other segment as a parameter). The preparation of 1:00 to the line segment (or extension) of the distance from other methods. Note: The preparation method, consider using the Point class approach to preparing test program

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值