The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Equation of a Rectangle?

Date: 11/11/2012 at 07:26:41
From: Ahmet
Subject: What is the Equation of a Rectangle in a Cartesian Plane

Simply put, I want to know if there is an equation for a rectangle.

Perhaps it would be similar to that for a circle, which is

   (x - h)^2 + (y - k)^2 = r^2

There must be some such equation out there. But because the graph of a
rectangle is not continuously smooth like it is for conic sections, it
cannot exist in the way we think of conic equations. I imagine it will be
somewhat implicit in nature.

If such an equation exists, can it be rotated using the same (x', y')
formulas for conics?

Unfortunately, I have done zero work in an attempt to derive the equation
of a rectangle -- way too advanced for me.

Date: 11/11/2012 at 11:28:09
From: Ahmet
Subject: What is the Equation of a Rectangle in a Cartesian Plane

One more thing: is there a way to define the equation from the center of
the rectangle, and perhaps use transformations to plot it at a location
other than the origin? And what about rotating the rectangle?

Date: 11/11/2012 at 11:36:12
From: Ahmet
Subject: What is the Equation of a Rectangle in a Cartesian Plane

I did find an equation on a Web site. Denoting the absolute value with "|":

   |x/p + y/q| + |x/p - y/q| = 2

I'm not sure how to solve this equation for "y," so I can't graph it to
verify it. 

Also, how would I transform this to another point or rotate it?

Date: 11/12/2012 at 18:45:33
From: Doctor Peterson
Subject: Re: What is the Equation of a Rectangle in a Cartesian Plane

Hi, Ahmet.

This is the sort of equation that requires some ingenuity to invent! I
briefly thought about doing it with absolute values when I first saw your
question, but didn't have the time to put into it.

It is NOT an equation that you can solve for y. To graph it, you have to
consider cases.

For example, |x/p + y/q| will be equal to x/p + y/q wherever the latter is
positive, namely in the region above the line y = -(q/p)x. Similarly, 
|x/p - y/q| will be equal to x/p - y/q, where the latter is positive, that
is, in the region below the line y = (q/p)x. (Each absolute value will be
the opposite in the opposite region.)

So in the region that is both above y = -(q/p)x and below y = (q/p)x, your
equation becomes

   (x/p + y/q) + (x/p - y/q) = 2

                        2x/p = 2

                           x = p

This is the vertical line forming the right side of the rectangle:

    .               +               .
        .           |           .   |
            .       |       .       |
                .   |   .           |
                .   |   .           |
            .       |       .       |
        .           |           .   |
    .               +               .

You can verify that in the other three regions determined by the two
lines, you get the other three sides of the rectangle.

You could translate this to another center as usual, replacing x with 
x - h and y with y - k. Rotation would mean replacing each of x and y with
an expression involving x and y, which perhaps you have seen. It would get

In general, not every shape can be reduced to a single, simple equation.
Without the absolute value trick, you would simply write this as four
separate lines (which is what you would get if you did manage to solve the
equation for y):

   x = p  for -q <= y <= q   (the part we just did)
   x = -p for -q <= y <= q
   y = q  for -p <= x <= p
   y = -q for -p <= x <= p

This is usually easier to work with than the "elegant" but unwieldy single

- Doctor Peterson, The Math Forum 

Date: 11/12/2012 at 22:25:05
From: Ahmet
Subject: Thank you (What is the Equation of a Rectangle in a Cartesian Plane)

I very much appreciate your time.

I guess this was the answer I was expecting the entire time.

Thanks again.
Associated Topics:
High School Coordinate Plane Geometry
High School Equations, Graphs, Translations
High School Triangles and Other Polygons

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.