diff options
| author | yum <yum.food.vr@gmail.com> | 2025-10-11 11:27:19 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-10-11 11:27:19 -0700 |
| commit | 06780e36b2aeb1257607c89570fd99903508b82e (patch) | |
| tree | d8496afcb9a3e3808c41ea50f4bd3e490595faf0 /test.slang | |
| parent | 1db7ecb9c0235b9317b5c318685bbbfa8a2309d1 (diff) | |
smol cleanup
Diffstat (limited to 'test.slang')
| -rw-r--r-- | test.slang | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -2,20 +2,22 @@ #define __CUSTOM31_INC [Differentiable] -public float3 cart_to_cyl(uniform float3 xyz) { - float radius = length(xyz.xy); - float theta = atan2(xyz.y, xyz.x); - return float3(radius, theta, xyz.z); +public float3 c31_deform(uniform float3 xyz) { + return float3( + sin(xyz.x) * sin(xyz.z), + xyz.y, + sin(xyz.x) * sin(xyz.z) + ); } -public float3x3 cart_to_cyl_jacobian(uniform float3 xyz, uniform float3 n) { +public float3x3 c31_deform_jacobian(uniform float3 xyz, uniform float3 n) { DifferentialPair<float3> dp_x = diffPair(xyz, float3(1, 0, 0)); DifferentialPair<float3> dp_y = diffPair(xyz, float3(0, 1, 0)); DifferentialPair<float3> dp_z = diffPair(xyz, float3(0, 0, 1)); - DifferentialPair<float3> dp_x_out = fwd_diff(cart_to_cyl)(dp_x); - DifferentialPair<float3> dp_y_out = fwd_diff(cart_to_cyl)(dp_y); - DifferentialPair<float3> dp_z_out = fwd_diff(cart_to_cyl)(dp_z); + DifferentialPair<float3> dp_x_out = fwd_diff(c31_deform)(dp_x); + DifferentialPair<float3> dp_y_out = fwd_diff(c31_deform)(dp_y); + DifferentialPair<float3> dp_z_out = fwd_diff(c31_deform)(dp_z); return float3x3(dp_x_out.d, dp_y_out.d, dp_z_out.d); } |
