验证中...
Languages: Java
Categories: 编程语言基础
Latest update 2019-06-25 20:48
gistfile1.txt
Raw Copy
package com.hello;
public class juli {
public double a=1;
public double b=1;
public double c=1;
public double x,y;
public void yuandian()
{
//点到直线的距离
x=y=0;
double d = Math.abs(a*x+b*y+c)/Math.sqrt(a*a+b*b);
System.out.println(d);
}
public void getjuli(double heng,double zong)
{ x=heng;
y=zong;
double d2=Math.abs(a*x+b*y+c)/Math.sqrt(a*a+b*b);
System.out.println(d2);
}
public static void main(String[] args) {
juli aJuli=new juli();
aJuli.getjuli(3, 4);
aJuli.yuandian();
}
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025