﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Keith Hair &#187; cartesian</title>
	<atom:link href="http://keith-hair.net/blog/tag/cartesian/feed/" rel="self" type="application/rss+xml" />
	<link>http://keith-hair.net/blog</link>
	<description>Scripting is fun like any other hobby</description>
	<lastBuildDate>Sat, 28 Jan 2012 05:04:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Different signs of Cosine, Sine, and Tangent functions and radians</title>
		<link>http://keith-hair.net/blog/2010/01/24/different-signs-of-cosine-sine-and-tangent-functions-and-radians/</link>
		<comments>http://keith-hair.net/blog/2010/01/24/different-signs-of-cosine-sine-and-tangent-functions-and-radians/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 18:27:43 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[cartesian]]></category>
		<category><![CDATA[coordinates]]></category>
		<category><![CDATA[Cosine]]></category>
		<category><![CDATA[quadrants]]></category>
		<category><![CDATA[Sine]]></category>
		<category><![CDATA[Tangent]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=176</guid>
		<description><![CDATA[This post might seem of little importance to some but today I was thinking back to my high school days and (vaguely) remember the 4 quadrants of a Cartesian coordinate plane discussed in class. Depending on the positive or negative sign of a Point's X and Y value, that point in the Cartesian coordinate plane [...]]]></description>
			<content:encoded><![CDATA[<p>
This post might seem of little importance to some but today I was thinking back to my high school days and (vaguely) remember the 4 quadrants of a Cartesian coordinate plane discussed in class. Depending on the positive or negative sign of a Point's X and Y value, that point in the Cartesian coordinate plane will be located in one of these 4 quadrants.</p>
<blockquote><p><strong>Quadrant 1 = (+,+)<br />
Quadrant 2 = (-,+)<br />
Quadrant 3 = (-,-)<br />
Quadrant 4 = (-,+)</strong></p></blockquote>
<p>My interest in this post is about the positive or negative sign of what the Cosine, Sine, and Tangent functions return for the same angle...the angle from one Point to another Point. The sign of these 3 Math functions are different also whenever a Point is located in one of the 4 quadrants.</p>
<blockquote><p><strong>Quadrant 1 = +Sine,+Cosine,+Tangent<br />
Quadrant 2 = +Sine,-Cosine,-Tangent<br />
Quadrant 3 = -Sine,-Cosine,+Tangent<br />
Quadrant 4 = -Sine,+Cosine,-Tangent</strong></p></blockquote>
<p>Personally I don't think the order or name of the quadrants are important, as long as you keep them consistent with the coordinate system. For my usage, I order my quadrants "1,2,3,4" clockwise since ActionScript's radians values go clockwise.</p>
<p>I feel this will become useful sometime in the future for me when dealing with angles of Points and determining their positions relative to each other.<br />
In a future situation I might not be given X and Y information, but may only have angle data instead. Seeing the difference of signs from the Cosign, Sine, Tangent output of the angle value will be helpful clues.</p>
<p>So some things come back to haunt you, if they are the ghosts of my math teachers, I will surely pay attention in class this time <img src='http://keith-hair.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_quadrants_1144907996"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="/blog/examples/different_signs/quadrants.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/blog/examples/different_signs/quadrants.swf"
			name="fm_quadrants_1144907996"
			width="550"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
<span id="more-176"></span><br />
Note in Flash/Actionscript, (0,0) is wherever you set your registration point of a MovieClip. In this example I centered the registration point in Flash,<br />
so (0,0) of head's coordinate system will sit directly at the center of the head.</p>
<pre class="brush: as3; title: ; notranslate">
	/*=========================================================
	Using &quot;Math.atan2&quot; to get the angle (in radians) between
	the &quot;reddot&quot; and &quot;head&quot;.

	This radian is fed into the &quot;getSign&quot; function so
	we can see the difference of signs.
	===========================================================*/

	var radians=Math.atan2(reddot.y-head.y,reddot.x-head.x);
	var signs:Object=getSigns(radians);
	var output:String=&quot;&quot;;

	output+=&quot;Sine:&quot;+signs.sine;
	output+=&quot;\n&quot;;
	output+=&quot;Cosine:&quot;+signs.cosine;
	output+=&quot;\n&quot;;
	output+=&quot;Tangent:&quot;+signs.tangent;
	output+=&quot;\n&quot;;
	output+=&quot;\n&quot;;
	output+=&quot;Radians:&quot;+radians;

	status.text=output;
</pre>
<pre class="brush: as3; title: ; notranslate">
/*============================================
Returns an object indicating the sign
of the radian's Cosine, Sine and Tangent.
==============================================*/
function getSigns(rad:Number):Object
{
	var o:Object=new Object();
	if(Math.sin(rad) &gt;= 0){
		o.sine=&quot;+&quot;;
	}else{
		o.sine=&quot;-&quot;;
	}
	if(Math.cos(rad) &gt;= 0){
		o.cosine=&quot;+&quot;;
	}else{
		o.cosine=&quot;-&quot;;
	}
	if(Math.tan(rad) &gt;= 0){
		o.tangent=&quot;+&quot;;
	}else{
		o.tangent=&quot;-&quot;;
	}
	return o;
}
</pre>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2010/01/24/different-signs-of-cosine-sine-and-tangent-functions-and-radians/&ztz=Different signs of Cosine, Sine, and Tangent functions and radians'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2010/01/24/different-signs-of-cosine-sine-and-tangent-functions-and-radians/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

