Coordinate of a point in 3 dimensions

P

Piotre Ugrumov

How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

thanks.
 
V

Victor Bazarov

Piotre Ugrumov said:
How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

The usual way is to define some kind of data structure that holds
the necessary values and return an instance of it:

struct SphericalCoords {
double c, alpha, beta;
};

SphericalCoords corner( blah blah

Victor
 
G

Gianni Mariani

Piotre said:
How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

Far too little information to conclude what it is you want.
 
A

Allan Bruce

Piotre Ugrumov said:
How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

thanks.

I dont know how to solve your problem as you havent said what half of your
variables are, however I do know that velocity in 3D space requires 3
values, much like position. Velocity is a vector, which has a direction so
therefore requires as many elements as there are dimensions.
HTH
Allan
 
T

Thomas Matthews

Piotre said:
How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

I don't understand what the alpha and beta values are for. A point in
Cartesian space only requires three dimensions, usually named x, y
and z.

Points don't have a velocity; points are a location. Objects have
a velocity and a location _at_a_given_time. Velocity, depending on
how you define it, may have a magnitude or a magnitude and direction.
One could say that an object has two components: location & time;
at time it will be at location[j].


How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.

What is the relationship of a two dimensional "corner" and a
three dimensional point? You will need some kind of transformation
matrix to convert from 3 dimensions to 2. There will also be a loss
of information in the process.

For example, one could define a _projection_ of a 3 dimensional object
onto a 2 dimensional grid. This is how 3 dimension objects are
represented on a two dimensional screen or canvas.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

The prototype of a given function depends on what it needs and
what it produces. Once those items or types are known, creating the
prototype is easy.

Your post indicates that you need a better understanding of the
requirements.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
H

Howard

Thomas Matthews said:
Objects have a velocity and a location _at_a_given_time.

Just to throw a monkey wrench into the works here: according the the
Heisenberg Uncertainty Principle, one cannot know both an object's velocity
vector AND it's location exactly (at the same time). The more you know
about one, the less you know about the other. If you exactly locate an
object in space, you lose all information about its velocity vetor, and
vice-versa.

Probably not of any use here, since any simulation of movement of objects in
space is bound to explicitly calculate (set) both values. Just thought I'd
cause trouble. :)

-Howard
 
J

Jeff Schwab

Howard said:
Just to throw a monkey wrench into the works here: according the the
Heisenberg Uncertainty Principle, one cannot know both an object's velocity
vector AND it's location exactly (at the same time). The more you know
about one, the less you know about the other. If you exactly locate an
object in space, you lose all information about its velocity vetor, and
vice-versa.

You're almost right. The uncertainty in position is inversely
proportional to the uncertainty in momentum, not velocity. The OP's
class admittedly knows nothing about mass. ;)
Probably not of any use here, since any simulation of movement of objects in
space is bound to explicitly calculate (set) both values. Just thought I'd
cause trouble. :)

Are you the one who keeps posting that "which is better" kindling? An
awful lot of C vs. C++, C# vs. Java, Windows vs. Unix stuff seems to
have cropped up lately. :(
 
H

Howard

Jeff Schwab said:
Are you the one who keeps posting that "which is better" kindling? An
awful lot of C vs. C++, C# vs. Java, Windows vs. Unix stuff seems to
have cropped up lately. :(

No, I hate that crap as much you obviously do. :)

-Howard
 
J

Jumbo

Piotre Ugrumov said:
How can I implement a function that calculate the coordinates of a point, in
3 dimensional space?
The function take 6 value (x, y, z, v(velocity), corner alfa, corner beta).
The prototype is this:

double coordinate(double x, double y, double z, double c, double alfa,
double beta);

How can I implement a function that return the corner alfa e beta? The
funcion take the coordinates of 2 point.
What is the prototypa of this function?

??????? corner(double x1, double y1, double z1, double x2, double y2, double
z2);

thanks.
Perhaps it's an object moving within an object(say a point moving around
inside a cube) then with that..
as the point nears the centre of the cube it slows down thus simulating some
kind of attraction of the point to the outside of the cube.
So the dot is boucing around inside the cube but with an gravitational pull
towards the outside.
However if everything was balanced it wouldn't bounce for long before it
came to rest, so there's two corners which are pushing and pulling on the
object(emitting a force upon the object) but the push/pull of these corners
is rapidly switching direction.

Thus the need for velocity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top