Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

i need to know the formula to get the coordinates that are on the perimeter and within the shape of square and rectangle. does anyone know that?

lets say square coordinates of (1,1) , (1,3) , (3,3) , (3,1)

points on perimeter would be (1,2) , (2,1) , (2,3) , (3,2) excluding the actual coordinates above.

points within shape would be (2,2)

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,417

hi zxcvbnm123

Welcome to the forum.

I seem to remember there is a formula, so I'll try to find it. Failing that, maybe I can work it out.

Back soon.

EDIT: This is the one I remembered:

http://en.wikipedia.org/wiki/Pick's_theorem

It's not quite what you want, but it'll give you a start.

Are the sides of the shapes parallel to the axes ? (Harder if not)

Bob

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

yes all lines and sides are parallel

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

Do you want just points with integer coordinates?

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

yes just need point with integer . the type of answer i need is what i shown above.

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

Well, for the points on the edges, if the square's coordinates are (a,a), (a,b), (b,a) and (b,b), they are:

(a,a+k), 0<k<b-a

(b,a+k), 0<k<b-a

(a+k,a), 0<k<b-a

(a+k,b), 0<k<b-a

As for the points inside the square, they all have coordinates of the form:

(a+k,a+l), 0<k,l<b-a

*Last edited by anonimnystefy (2013-05-08 06:28:03)*

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

i am sorry, i am very new to geometry coordinates... i dont understand your formula...can give me one example how you use that formula to get the answers?

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

Hm, well, let's try with a=1 and b=4.

That would be the square (1,1), (1,4), (4,1), (4,4).

If draw it in the Cartesian coordinate system, you will see that the point on the edge are (1,2), (1,3), (2,1), (2,4), (3,1), (3,4), (4,2) and (4,3). By the formulas above we get:

(1,1+k), for 0<k<3, which gives (1,1+1)=(1,2) and (1,1+2)=(1,3)

(4,1+k), for 0<k<3, which gives (4,1+1)=(4,2) and (4,1+2)=(4,3)

(1+k,1), for 0<k<3, which gives (1+1,1)=(2,1) and (1+2,1)=(3,1)

(1+k,4), for 0<k<2, which gives (1+1,4)=(2,4) and (1+2,4)=(3,4)

If you compare the two sets of points, you will see we got the same points by drawing the square on the grid and by the formulas above.

Oh, just wondering, what do you need this for?

*Last edited by anonimnystefy (2013-05-08 08:26:32)*

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

some homework unrelated to maths...and we need to create this formula

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

Programming, maybe?

Are you a bit clearer about the formulas?

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

yes thank you very much , brilliant formula . rushing my work now

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

can give me a example on how you get the answer for points within shape? and i think l is l<b not l<b-a

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

Well, if we take the square as in the last example, we know that the points inside the square are (2,2), (2,3), (3,2) and (3,3).

What do you get when you do

(1+k,1+l), for 0<k<3, 0<l<3?

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**zxcvbnm123****Member**- Registered: 2013-05-08
- Posts: 15

its ok i got it already

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,039

That is great!

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline