Skip to content

Distancetozone

Featured Replies

Hi tryskell :) i got a question specificaly for you. in aCis and in other packs getDistanceToZone basically show the distance from the points you set in Zone.

So basically if you're inside zone in the middle of town it will still write Distance: 2250 cause it's away of points. 

What if we want to do this: 

 

iWPzlEI.jpg

 

Basically if the object is inside zone distance = 0

If the object is between 2 points close to the line it will write 50 

so the distance isbeing calculated after the line 2 points create. 

 

Is possible? 

 

First I'm terrible in whatever mathematics (and even worst in geometry), you're probably better than me.

 

Second if the formula doesn't appeal you, you can edit it (and well you named it, ZoneNPoly.getDistanceToZone).

 

I guess you can simply consider if you're inside the square, you return 0 directly if that's your only problem. Since isInsideZone is part of the same class, you only have to generate a x/y version of isInsideZone (which currently verify x/y/z) and check that first.

 

PS : You don't need to name me on topic, it's disturbing.

Edited by Tryskell

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.