Page **1** of **1**

### [Question] Perimeter

Posted: **Mon May 21, 2018 5:51 pm**

by **456mb**

Hi !

i start a proyect in the university but i have a big question (sry my language native no is english), i want check via GPS if the prototype is inside of the irregular area, image of example

i dont have problem with sensor, the big big dude is, how check is inside of the irregular perimeter, some idea for start ?

any idea is welcome

thanks for you time

### Re: [Question] Perimeter

Posted: **Mon May 21, 2018 6:20 pm**

by **HawaiianPi**

That depends on how the perimeter is defined. For example, painted lines could be detected with a camera. If the perimeter is not clearly marked, then it becomes more difficult. GPS might work for an outdoor location, but might not work inside a building (or any location with poor GPS reception). We really need more information to help you.

### Re: [Question] Perimeter

Posted: **Mon May 21, 2018 6:25 pm**

by **B.Goode**

any idea is welcome

Go to the Mathematics Department of your University and ask them to teach you some (Cartesian) coordinate geometry.

It is an interesting question.

But it is not one that is directly related to the use of a Raspberry Pi.

### Re: [Question] Perimeter

Posted: **Mon May 21, 2018 7:56 pm**

by **456mb**

HawaiianPi wrote: ↑Mon May 21, 2018 6:20 pm

That depends on how the perimeter is defined. For example, painted lines could be detected with a camera. If the perimeter is not clearly marked, then it becomes more difficult. GPS might work for an outdoor location, but might not work inside a building (or any location with poor GPS reception). We really need more information to help you.

yes, that use in open field, the points will be configured previusly (point = GPS position)

The general idea is use in a motorbike for big places, but the first step is detect the area

### Re: [Question] Perimeter

Posted: **Mon May 21, 2018 8:31 pm**

by **drgeoff**

B.Goode wrote: ↑Mon May 21, 2018 6:25 pm

Go to the Mathematics Department of your University and ask them to teach you some (Cartesian) coordinate geometry.

Surely anyone in a University faculty doing this project would have already been taught coordinate geometry at school.

### Re: [Question] Perimeter

Posted: **Mon May 21, 2018 9:06 pm**

by **456mb**

drgeoff wrote: ↑Mon May 21, 2018 8:31 pm

B.Goode wrote: ↑Mon May 21, 2018 6:25 pm

Go to the Mathematics Department of your University and ask them to teach you some (Cartesian) coordinate geometry.

Surely anyone in a University faculty doing this project would have already been taught coordinate geometry at school.

it's irony ?

its a free proyect, the question how to pass the points to identify them as a "side"

### Re: [Question] Perimeter

Posted: **Tue May 22, 2018 7:49 pm**

by **ejolson**

drgeoff wrote: ↑Mon May 21, 2018 8:31 pm

B.Goode wrote: ↑Mon May 21, 2018 6:25 pm

Go to the Mathematics Department of your University and ask them to teach you some (Cartesian) coordinate geometry.

Surely anyone in a University faculty doing this project would have already been taught coordinate geometry at school.

Maybe even Calculus, but apparently not on this forum. Does

Green's theorem help?

### Re: [Question] Perimeter

Posted: **Tue May 22, 2018 8:55 pm**

by **B.Goode**

the question how to pass the points to identify them as a "side"

Presumably you will represent the points defining the area as pairs of coordinates in the form returned by a GPS receiver. The standard used to be WGS84, but that may no longer be current.

I think I remember that if you know the coordinates of 2 points in a plane you can deduce the equation for the straight line passing through those points? The portion of that line between the 2 positions represents a side of your boundary shape.

(Still not sure why this is in a Raspberry Pi forum.)

### Re: [Question] Perimeter

Posted: **Tue May 22, 2018 10:13 pm**

by **ejolson**

B.Goode wrote: ↑Tue May 22, 2018 8:55 pm

(Still not sure why this is in a Raspberry Pi forum.)

I think the idea is to build a GPS surveying tool using Raspberry Pi. Green's theorem is surely the way to compute the area. Please read the whole Wikipedia article I linked to in my previous post.

### Re: [Question] Perimeter

Posted: **Tue May 22, 2018 10:54 pm**

by **gkaiseril**

One might also want to look at the

Coastline paradox. It might not be as simple as some think.

### Re: [Question] Perimeter

Posted: **Wed May 23, 2018 2:28 am**

by **ejolson**

gkaiseril wrote: ↑Tue May 22, 2018 10:54 pm

One might also want to look at the

Coastline paradox. It might not be as simple as some think.

Interesting article. While the length of the coastline may not be well defined, the area enclosed is. But now that I reread the question I see that it isn't a matter of finding the area, but whether a particular point is inside or outside the area. Again the answer can be determined by an integral over the perimeter, just a different one than for finding area.

### Re: [Question] Perimeter

Posted: **Wed May 23, 2018 8:43 am**

by **scotty101**

The information at this link seems helpful

http://alienryderflex.com/polygon/

### Re: [Question] Perimeter

Posted: **Sat May 26, 2018 5:09 am**

by **456mb**

thank all the guys for taking the time to help me find a solution

I want to thank you, I turned google looking for information but I did not succeed

It's just what I needed to put the idea, I want to tell you that this was the last problem for my project to work.

Really thank you

### Re: [Question] Perimeter

Posted: **Sat Jun 02, 2018 2:04 am**

by **Heater**

There is a much simpler way to find if a point is inside or outside a polygon. Use the "winding number algorithm" See here:

https://en.wikipedia.org/wiki/Point_in_polygon