In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces java how to achieve coordinate distance, the article is very detailed, has a certain reference value, interested friends must read it!
Package testmypoint;class MyPoint {private double x; private double y; public MyPoint () / / the default value {this.x=x; this.y=y 0; y = 0;} public MyPoint (double x Magneto double y) {this.x=x; this.y=y } public double distance (MyPoint m) / / give a point {double a=Math.sqrt ((this.x-m.x) * (this.x-m.x) + (this.y-m.y) * (this.y-m.y)); return a } public double distance (double xscene double y) / / give the coordinates {double a=Math.sqrt ((this.x-x) * (this.x-x) + (this.y-y) * (this.y-y)); return a;}} public class TestMyPoint / / the distance from the test class ((10Power30.5) to (0Power0)) {public static void main (String [] args) {MyPoint a1=new MyPoint () MyPoint a2=new MyPoint (10Jet 30.5); System.out.printf ("% .2f\ n", a1.distance (a2)); System.out.printf ("% .2f\ n", a1.distance (10J 30.5));}} above is all the content of the article "how java achieves coordinate distance". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.