{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"vector-operations"},"result":{"entity_type":"calculator","id":"vector-operations","calculator_id":"vector-operations","canonical_url":"https://tttkmbb.com/math/vector-operations","name":"Vector Calculator","title":"Vector Calculator – Dot Product, Cross Product, Magnitude, Angle, Unit Vectors and Projection (2D and 3D)","category":"math","category_name":"Math","tool_name":"calculate_vector_operations","featured_mcp_tool":false,"description":"Computes, for two vectors in 2D or 3D, their magnitudes, dot product, cross product, the angle between them, unit vectors, the scalar and vector projection of the first onto the second, and their sum and difference.","use_when":"You have two vectors with numeric components and need any of the standard products, the angle between them, or the projection of one onto the other.","do_not_use_when":"You need the distance between two points rather than vector products (use distance-3d or distance-2d), or the vectors have more than 3 components.","inputs":[{"name":"vector_a","label":"Vector a","type":"number_list","required":true,"description":"Components of the first vector, 2 or 3 numbers (e.g. 1, 2, 3).","example":[1,2,3]},{"name":"vector_b","label":"Vector b","type":"number_list","required":true,"description":"Components of the second vector, with the same number of components as vector_a.","example":[4,5,6]}],"outputs":[{"name":"dot_product","label":"Dot product a·b","type":"number","decimals":6,"description":"Σ aᵢ·bᵢ; zero when the vectors are perpendicular."},{"name":"cross_product","label":"Cross product a×b","type":"number_list","decimals":6,"description":"[a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁]; 2D vectors are treated as 3D with z = 0, so only the third component can be non-zero."},{"name":"cross_product_magnitude","label":"|a×b|","type":"number","decimals":6,"description":"|a|·|b|·sin θ, the area of the parallelogram spanned by a and b."},{"name":"magnitude_a","label":"|a|","type":"number","decimals":6,"description":"Length of vector a, √(Σ aᵢ²)."},{"name":"magnitude_b","label":"|b|","type":"number","decimals":6,"description":"Length of vector b."},{"name":"angle_degrees","label":"Angle between a and b","type":"number","unit":"°","decimals":4,"description":"arccos(a·b / (|a|·|b|)) in degrees, 0–180."},{"name":"angle_radians","label":"Angle (radians)","type":"number","unit":"rad","decimals":6,"description":"The same angle in radians."},{"name":"unit_vector_a","label":"Unit vector â","type":"number_list","decimals":6,"description":"a / |a|."},{"name":"unit_vector_b","label":"Unit vector b̂","type":"number_list","decimals":6,"description":"b / |b|."},{"name":"scalar_projection","label":"Scalar projection of a onto b","type":"number","decimals":6,"description":"a·b / |b| (signed length of a along b)."},{"name":"vector_projection","label":"Vector projection of a onto b","type":"number_list","decimals":6,"description":"(a·b / |b|²) · b."},{"name":"sum","label":"a + b","type":"number_list","decimals":6,"description":"Component-wise sum."},{"name":"difference","label":"a − b","type":"number_list","decimals":6,"description":"Component-wise difference."},{"name":"relationship","label":"Relationship","type":"string","decimals":4,"description":"'perpendicular', 'parallel (same direction)', 'parallel (opposite direction)' or 'neither', from the angle."}],"input_schema":{"type":"object","properties":{"vector_a":{"description":"Components of the first vector, 2 or 3 numbers (e.g. 1, 2, 3).","type":"array","items":{"type":"number"},"minItems":2,"examples":[[1,2,3]]},"vector_b":{"description":"Components of the second vector, with the same number of components as vector_a.","type":"array","items":{"type":"number"},"minItems":2,"examples":[[4,5,6]]}},"additionalProperties":false,"required":["vector_a","vector_b"]},"output_schema":{"type":"object","properties":{"dot_product":{"description":"Σ aᵢ·bᵢ; zero when the vectors are perpendicular.","type":"number"},"cross_product":{"description":"[a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁]; 2D vectors are treated as 3D with z = 0, so only the third component can be non-zero.","type":"array","items":{"type":"number"}},"cross_product_magnitude":{"description":"|a|·|b|·sin θ, the area of the parallelogram spanned by a and b.","type":"number"},"magnitude_a":{"description":"Length of vector a, √(Σ aᵢ²).","type":"number"},"magnitude_b":{"description":"Length of vector b.","type":"number"},"angle_degrees":{"description":"arccos(a·b / (|a|·|b|)) in degrees, 0–180. Unit: °.","type":"number","x-unit":"°"},"angle_radians":{"description":"The same angle in radians. Unit: rad.","type":"number","x-unit":"rad"},"unit_vector_a":{"description":"a / |a|.","type":"array","items":{"type":"number"}},"unit_vector_b":{"description":"b / |b|.","type":"array","items":{"type":"number"}},"scalar_projection":{"description":"a·b / |b| (signed length of a along b).","type":"number"},"vector_projection":{"description":"(a·b / |b|²) · b.","type":"array","items":{"type":"number"}},"sum":{"description":"Component-wise sum.","type":"array","items":{"type":"number"}},"difference":{"description":"Component-wise difference.","type":"array","items":{"type":"number"}},"relationship":{"description":"'perpendicular', 'parallel (same direction)', 'parallel (opposite direction)' or 'neither', from the angle.","type":"string"}}},"formula":"a·b = Σ aᵢbᵢ; a×b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁); |a| = √(a·a); cos θ = a·b / (|a|·|b|); proj_b a = (a·b / |b|²)·b; scalar projection = a·b / |b|","method":"The angle is evaluated as atan2(|a×b|, a·b), which equals arccos(a·b / (|a|·|b|)) but keeps full precision for nearly parallel or perpendicular vectors; 'parallel' and 'perpendicular' are reported when sin θ or cos θ is below 10^-9.","sources":[{"name":"Wikipedia – Dot product","url":"https://en.wikipedia.org/wiki/Dot_product","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Cross product","url":"https://en.wikipedia.org/wiki/Cross_product","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Vector projection","url":"https://en.wikipedia.org/wiki/Vector_projection","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"a = (1, 2, 3), b = (4, 5, 6)","inputs":{"vector_a":[1,2,3],"vector_b":[4,5,6]},"expected":{"dot_product":32,"cross_product":[-3,6,-3],"cross_product_magnitude":7.348469,"magnitude_a":3.741657,"magnitude_b":8.774964,"angle_degrees":12.9332,"unit_vector_a":[0.267261,0.534522,0.801784],"scalar_projection":3.646738,"vector_projection":[1.662338,2.077922,2.493506],"sum":[5,7,9],"difference":[-3,-3,-3],"relationship":"neither"},"url":"https://tttkmbb.com/api/v1/calculate/vector-operations?vector_a=1%2C2%2C3&vector_b=4%2C5%2C6"},{"name":"a = (3, 4), b = (4, −3)","inputs":{"vector_a":[3,4],"vector_b":[4,-3]},"expected":{"dot_product":0,"cross_product":[0,0,-25],"magnitude_a":5,"magnitude_b":5,"angle_degrees":90,"unit_vector_a":[0.6,0.8],"scalar_projection":0,"vector_projection":[0,0],"relationship":"perpendicular"},"url":"https://tttkmbb.com/api/v1/calculate/vector-operations?vector_a=3%2C4&vector_b=4%2C-3"}],"faq":[{"q":"Is the cross product defined in 2D?","a":"Not as a vector; the calculator embeds 2D vectors in the xy-plane and returns (0, 0, a₁b₂ − a₂b₁), whose third component is the signed area of the parallelogram they span."},{"q":"Why is the angle between 0° and 180°?","a":"The angle from the dot product is the unsigned angle between the directions; 0° means the same direction, 90° perpendicular and 180° opposite."}],"tags":["vector calculator","dot product","cross product","angle between vectors","vector projection","unit vector"],"related":[{"calculator_id":"distance-3d","reason":"Distance and direction cosines between two points in space."},{"calculator_id":"matrix-determinant","reason":"The cross product is the determinant of a 3×3 matrix."},{"calculator_id":"angle","reason":"Convert the angle between degrees, radians and gradians."}],"links":{"html":"https://tttkmbb.com/math/vector-operations","markdown":"https://tttkmbb.com/math/vector-operations.md","json":"https://tttkmbb.com/math/vector-operations.json","api":"https://tttkmbb.com/api/v1/calculate/vector-operations","schema":"https://tttkmbb.com/api/v1/calculators/vector-operations","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:51:00Z"}