Java的直线的点判断

来源:互联网 发布:mac安装flash 编辑:程序博客网 时间:2024/06/06 23:55

package com.lesson19;

public class TestPoint {

 double a=2,b=3;
 
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  TestPoint aa = new TestPoint();
  boolean str = aa.myPoint(1, 5);
  System.out.println(str);
 }

 boolean myPoint(int x, int y) {
  return y == (a * x + b);
 }

}