1001Ferramentas
➡️ Calculators

Vector Projection Calculator

Computes scalar and vector projection of vector u onto vector v in three dimensions using dot product and unit vector.

Projection of one vector onto another

The vector projection of u onto v is the vector pointing along v that sits closest to u: projv(u) = (u · v / |v|²) · v. That scalar out front, u · v / |v|², is what rescales v. Multiply it by |v| instead and you get the scalar projection, the signed length of the shadow, compv(u) = u · v / |v|. What's left over, u − projv(u), is the piece of u that runs orthogonal to v, and this orthogonal decomposition is exactly what the Gram–Schmidt process is built on. Take u = (3, 4, 5), v = (1, 0, 0): u · v = 3 and |v|² = 1, so projv(u) = 3·(1, 0, 0) = (3, 0, 0), leaving an orthogonal residual of (0, 4, 5).

Applications

It shows up all over the place. In physics you use it to split a force into parts parallel and perpendicular to an inclined plane, like gravity acting along a ramp. Machine learning leans on it for Gram–Schmidt orthogonalisation, QR decomposition and PCA whitening. Computer graphics needs it for reflection and shadow vectors (r = u − 2·projn(u)). In signal processing it's how you project onto a basis to get Fourier coefficients, and in robotics it pulls out the velocity component that lines up with the direction of motion.

FAQ

What if v is the zero vector? Then |v|² = 0 and the formula breaks down. There's simply no direction to project onto, so the input should be treated as invalid.

Vector projection vs scalar projection — what changes? The vector projection hands you back a vector pointing along v, while the scalar projection gives you only the signed magnitude. The two connect through projv(u) = compv(u) · (v/|v|).

Why does the result point opposite to v sometimes? Whenever u · v < 0, the angle between u and v is obtuse, and the projection ends up pointing the other way from v. It's the sign of the dot product that decides the orientation.

Related Tools

📏

3D Dot Product Calculator

Calculate the dot product (scalar product) of two 3D vectors from their x, y and z coordinates. Useful in physics, computer graphics and vector geometry.

🏭

IPI Tax Calculator

Calculate the Brazilian IPI tax on a product from the tax base and rate. Instantly see the tax amount and the total price with IPI included.

3D Dot Product

Computes the dot product of two vectors in R3 from their components in a single line.

📈

I-Spread (Swap Spread)

Computes the I-spread, the difference between a bond's yield and the interpolated swap rate of the same maturity. It measures the bond's credit premium against the swap curve, which many consider a better reference than government bonds for pricing credit. The result comes in basis points. It's a cousin of the G-spread, but uses the swap rather than the government as the comparison base. Enter the bond's yield and the swap rate of the same maturity.

🌈

Rainbow Option on the Maximum (Stulz)

Computes the price of a call on the maximum of two assets with the Stulz (1982) formula: the option pays based on the better performer of two correlated assets, minus the strike. It's a bet on the winner of a race between two assets, and its price depends heavily on the correlation between them — the less correlated, the more valuable, because there's a greater chance at least one takes off. It uses the bivariate normal. Enter the two prices, the strike, the two volatilities, the correlation, the rate and the term.

📊

G-Spread (Government Spread)

Computes the G-spread, the difference between a bond's yield and the yield of a government bond of comparable maturity. It's the most direct measure of a bond's credit risk premium: how much extra the market demands to lend to a corporate issuer instead of the treasury. The result comes in basis points, the standard unit of the credit market. Enter the bond's yield and the reference government bond's yield.

The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.