Solved

Vector scaling to a specific value

Posted on 2008-11-01
4
700 Views
Last Modified: 2012-06-27
Suppose I have a 3D normal vector (x,y,z), and I am given a brightness value V. How can I find the scaling factor such that x^2 + y^2 + z^2 = V^2?
0
Comment
Question by:sph2105
  • 3
4 Comments
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 22860173
If you know x, y, and z (which it sounds like you do) then "V" is the magnitude of the vector:

   V = sqrt[x^2 + y^2 + z^2]

But you've already said that you have a "3D normal vector," which means the magnitude is 1 (and so is V then), so this question doesn't really make sense. Can you please clarify?
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 22860195
If you have a unit vector, then:

 x^2 + y^2 + z^2 = 1

and:

 v^2(x^2 + y^2 + z^2) = V^2

So:

 V^2 * x^2 + V^2 * y^2 + V^2 * z^2 = V^2

So, given V you're components are:

 (Vx,Vy,Vz)

0
 

Author Comment

by:sph2105
ID: 22860302
Sorry. Let me clarify.

x,y and z are indeed known,
V is some value that I have precalculated from some other function.

I need to scale x,y and z such that its magnitude (i.e. sqrt(x^2 + y^2 + z^2)) is equal to V.

Another way to look at is, I need x^2 + y^2 + z^2 = V^2.

The magnitude of vector (x,y,z) is not necessarily equal to V. I need to scale x,y and z it so that it IS always equal to V.

Sorry about that
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 22860337
Then:

let's call the magnitude m.

m = sqrt[x^2 + y^2 + z^2]

Then:

You want: Vx/m, Vy/m, Vz/m


Turn the vector into a unit vector then scale by V.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How does Google get such fast response times? 5 191
Math question 3 97
Least Squares Curve Fitting 4 99
What is CANH and CANL voltage when CAN Trasceiver is in sleep mode ? 2 19
Before You Read The Article Please make sure you understand these two concepts: Variable Scope (http://www.php.net/manual/en/language.variables.scope.php) and Property Visibility (http://www.php.net/manual/en/language.oop5.visibility.php).  And to …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question