第八章第三十四题(几何:最右下角的点)(Geometry: bottom right point)

第八章第三十四题(几何:最右下角的点)(Geometry: bottom right point)

  • *8.34(几何:最右下角的点)在计算几何中经常需要从一个点集中找到最右下角的点。编写以下方法,从一个点的集合中返回最右下角的点。
    public static double[] getRightmostLowestPoint(double[][] points)
    编写一个测试程序,提示用户输入6个点的坐标,然后显示最右下角的点。下面是一个运行示例。
    Enter 6 points:1.5 2.5 -3 4.5 5.6 -7 6.5 -7 8 1 10 2.5
    The rightmost lowest point is (6.5,-7.0)
    *8.34(Geometry: bottom right point)In computational geometry, it is often necessary to find the lowest right corner point from a point set. Write the following method to return the bottom right point from a collection of points.
    public static double[] getRightmostLowestPoint(double[][] points)
    Write a test program, prompt the user to enter the coordinates of six points, and then display the point at the bottom right corner. Here is a running example.
    Enter 6 points:1.5 2.5 -3 4.5 5.6 -7 6.5 -7 8 1 10 2.5
    The rightmost lowest point is (6.5,-7.0)

  • 参考代码:

    package chapter08;
    
    import java.util.Scanner;
    
    public class Code_34 {
         
        public static void main(String args[]){
         
            Scanner cin = new Scanner(System.in);
            System.out.print("Enter 6 points:");
            double[][] points = new double[6][2];
    
            for
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值