OT: Cartesian Coordinate Quadrant Question.

D

Db

Hello Newsgroup,

Other than creating an application in C# 3.5 SP1, this question is more
mathematical. I have a function that returns the quadrant of an angle (in
radians), as a number, being 1, 2, 3, or 4. My question being is what quadrant is
the positive x-axis in? Or what is it taken to be in? I am assuming Q1.

Given that I test for the condition on;

ar: Angle in radians

x = cos(ar); y = sin(ar)

(x > 0; y > 0) => Q1
(x < 0; y > 0) => Q2
(x < 0; y < 0) => Q3
(x > 0; y < 0) => Q4

The +X-Axis (as you know) is 0.000 Radians, putting it through the cos, sin,
calculation test yields;

x = 1; y = 0, and Googling "what quadrant is positive x axis", yields multitudes
of Geometry, Trigonometry, Cartesian Coordinate, papers none of which test for
0.000 radians. I even was carried away on a lesson on Spherical Coordinates in
3D, man was that spiny....!

Come to think of, are any of the axis (+x, +y, -x, -y) categorised in a quadrant?

My apologies for the off topic.


Thanks and regards,
 
F

Family Tree Mike

Db said:
Hello Newsgroup,

Other than creating an application in C# 3.5 SP1, this question is more
mathematical. I have a function that returns the quadrant of an angle (in
radians), as a number, being 1, 2, 3, or 4. My question being is what quadrant is
the positive x-axis in? Or what is it taken to be in? I am assuming Q1.

Given that I test for the condition on;

ar: Angle in radians

x = cos(ar); y = sin(ar)

(x > 0; y > 0) => Q1
(x < 0; y > 0) => Q2
(x < 0; y < 0) => Q3
(x > 0; y < 0) => Q4

The +X-Axis (as you know) is 0.000 Radians, putting it through the cos, sin,
calculation test yields;

x = 1; y = 0, and Googling "what quadrant is positive x axis", yields multitudes
of Geometry, Trigonometry, Cartesian Coordinate, papers none of which test for
0.000 radians. I even was carried away on a lesson on Spherical Coordinates in
3D, man was that spiny....!

Come to think of, are any of the axis (+x, +y, -x, -y) categorised in a quadrant?

My apologies for the off topic.


Thanks and regards,

I would say that a given point on an axis is "in" neither quadrant.
However, when working on an app that needs something like you are doing, it
is probably best to return a point of, for example, (-5, 0) as being both in
quadrant II and quadrant III. Think of a mapping application. If your map
is showing the Southern and Western hemisphere, then it is probably better to
include points on the equator in both this map, and one that is of the
Northern and Western hemisphere.

As to your exact question of a function returning one quadrant for a point,
I would say though that it is best to be consistent. I would put the +x in
I, +y in II, -X in III and -Y in IV. I've never heard that defined by Euclid
or anyone else however. Just caveat it in the documentation for your code
and you should be fine.
 
D

Db

Thank you very much Family Tree Mike, may your tree grow and prosper with an
abundance of fruit.


|
|
| "Db" wrote:
|
| >
| > Hello Newsgroup,
| >
| > Other than creating an application in C# 3.5 SP1, this question is more
| > mathematical. I have a function that returns the quadrant of an angle (in
| > radians), as a number, being 1, 2, 3, or 4. My question being is what
quadrant is
| > the positive x-axis in? Or what is it taken to be in? I am assuming Q1.
| >
| > Given that I test for the condition on;
| >
| > ar: Angle in radians
| >
| > x = cos(ar); y = sin(ar)
| >
| > (x > 0; y > 0) => Q1
| > (x < 0; y > 0) => Q2
| > (x < 0; y < 0) => Q3
| > (x > 0; y < 0) => Q4
| >
| > The +X-Axis (as you know) is 0.000 Radians, putting it through the cos, sin,
| > calculation test yields;
| >
| > x = 1; y = 0, and Googling "what quadrant is positive x axis", yields
multitudes
| > of Geometry, Trigonometry, Cartesian Coordinate, papers none of which test for
| > 0.000 radians. I even was carried away on a lesson on Spherical Coordinates
in
| > 3D, man was that spiny....!
| >
| > Come to think of, are any of the axis (+x, +y, -x, -y) categorised in a
quadrant?
| >
| > My apologies for the off topic.
| >
| >
| > Thanks and regards,
| >
| > --
| > Db (D Flat)
| >
| >
| >
|
| I would say that a given point on an axis is "in" neither quadrant.
| However, when working on an app that needs something like you are doing, it
| is probably best to return a point of, for example, (-5, 0) as being both in
| quadrant II and quadrant III. Think of a mapping application. If your map
| is showing the Southern and Western hemisphere, then it is probably better to
| include points on the equator in both this map, and one that is of the
| Northern and Western hemisphere.
|
| As to your exact question of a function returning one quadrant for a point,
| I would say though that it is best to be consistent. I would put the +x in
| I, +y in II, -X in III and -Y in IV. I've never heard that defined by Euclid
| or anyone else however. Just caveat it in the documentation for your code
| and you should be fine.
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top