I'm trying to find a signed distance function (SDF) for a simple 2D isoscele triangle, which represents the Field of View of a robot / camera. Ideally the SDF is also differentiable.
So far I have tried the basic 2D SDF commonly found in shaders, but this is not applicable to my problem, as it involves calculation of non-differentiable functions.
Particularly I'm looking for the following (compare https://goldberg.berkeley.edu/pubs/Patil-ICRA2014-BSP-Sensing-Discontinuity-final.pdf):
Relationship between measurements and signed distance to valid sensing region: (a) The expected position p^xt of the robot or object lies outside the field of view Π (shown in yellow) of a sensor, corresponding to a positive signed distance, where no measurements are obtained. The normal vector n indicates the direction of closest approach.
Does anyone have any pointers on how to compute this?