Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please follow the instruction (In Java) Problem 3. (Comparable 3D Point) Implement an immutable data type Point3D in Point3D.java that represents a point in 3D

Please follow the instruction (In Java)

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Problem 3. (Comparable 3D Point) Implement an immutable data type Point3D in Point3D.java that represents a point in 3D and supports the following API: method/class Point3D(double x, double y, double z) double distance (Point3D that) description construct a point in 3D given its coordinates the Euclidean distancef between this point and that -1, 0, or 1 depending on whether this point's Euclidean distance to the origin is less than, equal to, or greater than that point's Euclidean distance to the origin, where the origin is (0,0,0) a comparator for comparing points based on their x-coordinates a comparator for comparing points based on their y-coordinates a comparator for comparing points based on their z-coordinates a string representation of the point, in "(x, y, z)" format int compareTo (Point3D that) static class XOrder static class YOrder static class ZOrder String toString( t The Euclidean distance between the points (xi,y, z1) and (x2, y2, 22) is given by /(x1 - x2)2 + (yi - 2)2 (21 - z2)2 $ java Point3D -3 1 6 -2 4 7 -6 8 6 (0.0, 5.0, 8.0) C-5.0, 7.0 -3.0) C-2.0, 4.0,7.0) C-6.0, 8.0, 6.0) C-2.0, 4.0,7.0) -5.0, -7.0 -3.0) (0.0, 5.0, 8.0) C-6.0, 8.0, 6.0) C-6.0, 8.0, 6.0) -5.0, -7.0, -3.0) C-2.0, 4.0, 7.0) (0.0, 5.0, 8.0) C-5.0, -7.0, -3.0) (-2.0, 4.0, 7.0) (0.0, 5.0, 8.0) C-6.0, 8.0, 6.0) C-5.0, 7.0 -3.0) (-6.0, 8.0, 6.0) C-2.0, 4.0, 7.0) (0.0, 5.0,8.0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

Evaluate the expression. (-2) 6

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago