Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this part please: 5 . Correct the definitions of the math operations. ( a ) The following functions are closely related.

I need help with this part please:
5. Correct the definitions of the math operations. (a) The following functions are closely related.
double dotWith(MathVector) should calculate the dot product. ..(x1,x2,x3,...,xN)(y1,y2,y3,...,yN)=x1y1+x2y2+x3y3+...+xNyN
You do not need to worry about a user attempting to find the dot product of vectors
of different dimensions.
double getMagnitude() should calculate the magnitude of the vector using Pythagoras...
(x1,x2,x3,...,xN)=qx21+x2+x23+...+x2N
I have attached everything I have so far for reference.
class MathVector {
private final int dim;
private final double[] values;
public MathVector(int N){
dim=N;
}
values = new double N;
public MathVector(double... arr){
dim= arr. length;
values = new double [dim];
for (int [i]=arr[i]dim,=v*dim;=[i]=virx=r**y=r**x,yrx=r**y=r**z=r**cos[idx-1]=val=0x?=0i=0;ii=0;i
image text in transcribed

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

Step: 3

blur-text-image

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

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

2. List the advantages of listening well

Answered: 1 week ago