Skip to content
DeepForgeby svx
All problems
EasyCalculusca-257

Inverse Polar Jacobian Determinant

Problem

The inverse polar map (x, y) -> (r, theta) has Jacobian determinant 1 / sqrt(x^2 + y^2).

Given x and y not both zero, return that determinant. Return None at the origin, where the map is singular.

Hint

This determinant is the reciprocal of the forward polar Jacobian determinant r.

Test cases

case 1
in: [3,4]
expected: 0.2
case 2
in: [1,0]
expected: 1
case 3
in: [0,2]
expected: 0.5
case 4
in: [0,0]
expected: null
Starter codePython
def inverse_polar_jacobian(x, y):
    # Return None at the origin
    # Your code here
    pass

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