encrypted-geofence icon indicating copy to clipboard operation
encrypted-geofence copied to clipboard

Support rotated rectangles

Open informaniac opened this issue 7 years ago • 4 comments

Hello, it is me again.

I added support for arbitrary rotated rectangular Geofences. This is done by homomorphically calculating the perpendicular projection of the point onto two non-opposing borders and comparing whether the length of the resulting vectors are not longer than the respective borders are. Mathematical proof can be found in this paper under section IV-Implementation.

To be more consistent with the mathematical descriptions in the paper I used a small vector class, which is a little bloated from other things that were tested with it. The prefix e_ indicates a homomorphically encrypted value.

With this it should be possible to evaluate triangles (taking a detour) by combining two rectangular Geofences.

informaniac avatar Oct 21 '18 15:10 informaniac

Thanks for sending this arXiv paper! It's good to see some research into this

Instead of a test using the same geobox, could your example use a rotated shape? That way we can be sure to have coordinates x1,y1 to x4,y4 in the right places

mapmeld avatar Oct 21 '18 17:10 mapmeld

Glad to help. I am working on it. Usually, this should not be much of a problem but somehow I managed to run into strange behaviour of my evaluation when the point was outside the geofence. This could take a while as I am prone to interchange latitudes and longitudes...

informaniac avatar Oct 22 '18 18:10 informaniac

hi ! I was just remembering this. Any luck on tests? Would be happy to add it in.

mapmeld avatar Dec 06 '18 03:12 mapmeld

hi. lately, i did not have too much time on my hands to test this. currently there seems to be the need to make a monte carlo simulation to picture the shape of the geofence by evaluating random coordinates near and inside of it.

It seems that the Geofences that I used for my first practical Proof of Concept worked because of their low rotation angle. Also, when I tested it, I left the Geofence to the left side. The coordinates that i could not evaluate correctly were outside to the right of the Geofence. If you want to test something, i could update the PR or my branch to include the current coordinates of this new (nearly 45 degree rotated) Geofence and add some testing coordinates

informaniac avatar Dec 06 '18 05:12 informaniac