Need help plotting a point in 3d space using 2 vector/origin sets.

Click For Summary

Homework Help Overview

The discussion revolves around the challenge of plotting a point in 3D space using two vectors originating from corners of a cube, with the goal of achieving high precision in the resulting coordinates. The original poster is seeking methods to generate integral vectors that can accurately represent the intersection of these vectors.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • The original poster describes a process involving vector calculations and seeks to simplify or improve the method for generating integral vectors. Some participants question the necessity of the cube in the problem setup and whether the intersection of the lines will occur given potential inaccuracies in the vectors. Others explore the implications of vector ratios on the likelihood of finding integral intersection points.

Discussion Status

The conversation is ongoing, with participants clarifying the problem's requirements and exploring different interpretations of the setup. There is a focus on the precision needed for the vectors and the potential challenges posed by inaccuracies in the calculations.

Contextual Notes

The original poster mentions the use of an arbitrary precision library for calculations, indicating constraints related to maintaining precision while working with potentially large numbers. The cube serves as a bounding box to increase the chances of finding suitable integral vectors.

Sintrinsic
Messages
3
Reaction score
0
Fist, this is for a personal project of mine, I've been out of school for some time, and all my old math skills seem to have abandoned me. For that reason, and because I have to translate anything I learn into functions compatible with c#'s math library, it'd probably be best to keep any answers as simple as possible. lol *sigh*

What I need to do, with absolute accuracy, is this:
1.) Create 2 almost normalized vectors originating from 2 predetermined corners of a cube, and with a common destination of a known(but randomly generated) point.
2.) Discard the original "target" point.
3.) Using only the newly defined vectors, "reconstitute" the original point from the imaginary intersection of the vectors.

The problem I'm facing:
1.) I need to save space without loosing accuracy, and I'd LIKE to find two vectors with integral x,y,z values. I could just adjust one axis to 1 and have my program incrementally cycle upward until the remaining axes become integral, but that could be very time consuming. I need a way to consistently find such an integral vector with a single function or set of functions. Points with a roughly limited number of decimal digits would also be acceptable, if the likelihood of purely integral points is too low.

The process I have so far, which only seems to work on perfectly diagonal points. lol If you can improve, simplify, or speed up (for a computer) any of this, feel free:
Vector = destination - origin
Unit Vector = (Vector/Sqrt(Add(Vector^2)))*100 << to give room for integral vector
Least Integral Vector = UnitVector/(Gcd(Abs(UnitVector)))
Intersect Point = Determinant({(Origin2-Origin1),Vector2,CrossProduct(Vector1, Vector2)}) / (CrossProduct(Vector1,Vector2)^2)

I wrote all of the above on Yacas, which has been wonderful for teaching myself math, ( http://yacas.sourceforge.net/homepage.html), but it's too slow to use in the final program, so I won't have the benefit of the pre-defined functions. Thanks a ton in advance, I've been wracking my brain for the last 12 hours on this, just today, and I think my brain may explode if I can't solve the problem.
 
Physics news on Phys.org
Let me see if I have the problem understood, because I don't see what the cube has to do with anything. You are given two points A and B (vertices on the cube, but so what?) and two vectors Da and Db pointing from A and B to a point P which you wish to determine. Is that what your problem boils down to, the intersection of two lines, or do I misunderstand?
 
Well, finding the intersection shouldn't be too hard, and my main issue is with finding vectors with suitable values. I need 100% precision in, say, < 5 digits total for each axis. As far as the re-creation of the point, though, you're correct. All I'll be doing is finding the intersection. The cube is necessary only as a bounding box for the potential position of the target point, and to increase the probability that my x,y,z cords will have a low-value integral point along the line. I assumed that if all three values are close to equal, it decreases the interval between integral values on each axis as the point progresses along the line, giving me a better chance of them all crossing .0 simultaneously. Is that faulty logic?
 
Last edited:
I don't really follow the last couple lines of your explanation. But here's something that bothers me. If your given points and vectors aren't exact, I mean really exact, your two lines almost certainly won't intersect. They might just come close to each other so the equations you get using their parametric forms will be inconsistent.
 
That's true, especially given the size of my cube. However, I'm using an arbitrary precision library to do the math, and just to be safe, I'm not evaluating the fractions into decimals until I've established the integral vectors. That's actually the reason why I need the integral vectors in the first place; Unless I do it this way, or at least manage to consistently generate a vector with < a handful of decimal digits, I could potentially be handling variables with 100's of digits in total, which would limit my ability to work them, as converting to a <65bit number would reduce precision.

I don't really follow the last couple lines of your explanation.

I assumed that if all three values are close to equal, it decreases the interval between integral values on each axis as the point progresses along the line, giving me a better chance of them all crossing .0 simultaneously.

As I visualize it, if anyone axis of a vector differs too significantly in its ratio to the remaining axes, the number of potential integral intersections along the the "line" is drastically reduced. (1,150,3), for example, has a lower chance of yielding such a point than (2, 3, 4). Restricting a randomly generated point to the bounds of a cube allows me to select a set of origins from the 8 corners of the cube, in order to create a vector with as close to a 1:1:1 ratio as possible.

integralWaveDiagram.jpg
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 73 ·
3
Replies
73
Views
9K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
2K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K