Skip to content
DeepForgeby svx
All problems
EasyLinear Algebrala-058

Parallelogram Area via Cross Product

Problem

Compute the area of the parallelogram spanned by 3D vectors u and v:

area = ||u x v||_2

Hint

The cross product magnitude equals base times height.

Test cases

case 1
in: [[1,0,0],[0,1,0]]
expected: 1
case 2
in: [[2,0,0],[0,3,0]]
expected: 6
case 3
in: [[1,1,0],[1,-1,0]]
expected: 2
case 4
in: [[1,2,3],[4,5,6]]
expected: 7.3484692283495345
Starter codePython
def parallelogram_area(u, v):
    # Your code here
    pass

4 test cases · run your code against them in the editor