Java vector
3258
$$
 Posted:
 Proposals: 0
 Remote
 #13605
 Archived
Description
Experience Level: Intermediate
A vector can be thought of as a line in ndimensional space.It can be defined by its two end points.Each end point is an ntuple, with a value for each dimension.We can compute the lenght of a vector by the following algorithms:
For each dimension n.
Find the length in this dimension.(finish  start).
Square the length.
Multiply together the length in all dimensions.
Take the square root of the product.
This is simply stating pythagoras theorem.Try in two dimensional space to(i.e simple graph) to convice yourself that is correct.
Now write a java program which does the following:
Has a filename passed into the main method(i.e as a command line parameter).
Reads from that file the data representing a series of vectors(see below for the file format).
Stores each vector in a suitable data structure.
Iterate through that data structure calculating the length of each vector, printing the data to another file.
HERE IS THE SEE BELOW
THE INPUT FILE WILL DEFINE a series of vectors,each represented on three lines .For each vector:
The first line will be a single integer defining the dimensions of this vector n.
The second line will have n integers in it, representing the start point of this vector.
The third line will haven integers in it, representing the end point of this vector.
In lines containing more than one integer the integer values will be seperated by a single space.
IMPORTANT NOTICE:USE JAVA IDE.
For each dimension n.
Find the length in this dimension.(finish  start).
Square the length.
Multiply together the length in all dimensions.
Take the square root of the product.
This is simply stating pythagoras theorem.Try in two dimensional space to(i.e simple graph) to convice yourself that is correct.
Now write a java program which does the following:
Has a filename passed into the main method(i.e as a command line parameter).
Reads from that file the data representing a series of vectors(see below for the file format).
Stores each vector in a suitable data structure.
Iterate through that data structure calculating the length of each vector, printing the data to another file.
HERE IS THE SEE BELOW
THE INPUT FILE WILL DEFINE a series of vectors,each represented on three lines .For each vector:
The first line will be a single integer defining the dimensions of this vector n.
The second line will have n integers in it, representing the start point of this vector.
The third line will haven integers in it, representing the end point of this vector.
In lines containing more than one integer the integer values will be seperated by a single space.
IMPORTANT NOTICE:USE JAVA IDE.
IBRAHEEM H.
0% (0)Projects Completed

Freelancers worked with

Projects awarded
0%
Last project
20 Oct 2018
United Kingdom
New Proposal
Create an account now and send a proposal now to get this project.
Sign upClarification Board Ask a Question

There are no clarification messages.