(Solved) : Create Two Classes Project First Basic 3d Cartesian Coordinate Stores X Y Z Value Distance Q28127569 . . .
You will create two classes for this project. The first will bea basic 3D Cartesian- Coordinate that stores and X,Y,Z value andhas a distance formula function to get the distance between twopoints.
The second class is a 3D Vector class that will do basic vectormath. It will inherit from the Cartesian coordinate since bothshare a similar base.
Point3D.h/.cpp
This class will be a 3D Cartesian-CoordinateProperties:
? double x,y,z Method:
? Constructor taking in x,y,z
? Getters and Setters
double GetDistance(Point3D*)
Vector3D.h/.cpp
This class inherits from Point3D since it alsocontains: X,Y,Z values and requires a distance formula.
Further Properties:
? double size – the size of the vector
? double ux,uy,uz – the vector components as a unit vector
? double angle – angle in radians
Further Methods
? Vector3D(x,y,z) – Constructor that takes in X,Y,Z thencalculates size, angle and unit vector
? Vector3D(p1,p2) – Constructor that takes in two Point3Ds andmakes a vector from them
? private CalculateSize()
? private CalculateUnitVector()
? public Vector3D* getUnitVector()- create and return the unitvector
? public double dotProduct(Vector3D* other) – returns dotproduct
? public Vector3D* crossProduct(Vector3D* other) – returns crossproduct vector
? public Vector3D* add(Vector3D* other) – add two vectorstogether get a third
? public Vector3D* subtract(Vector3D* other) – subtract twovectors together get a
third
? public void scale(double value) – multiply the vector by thevalue, don’t forget
you might need to recalculate angle, size and unit vectorcomponents
? Getters and setters
? Anything else you need to make these things work!
Main.cpp
Create a simple program showing off ALL thefunctionality of your classes.
Expert Answer
Answer to Create Two Classes Project First Basic 3d Cartesian Coordinate Stores X Y Z Value Distance Q28127569 . . .
OR