s-news
[Top] [All Lists]

Re: [S] Transforming continuous variables

To: <s-news@wubios.wustl.edu>, "Paul Schwarz" <Paul.Schwarz@cornell.edu>
Subject: Re: [S] Transforming continuous variables
From: "Daniel Rie" <rie@world.std.com>
Date: Mon, 27 Apr 1998 08:57:35 -0400
Reply-to: "Daniel Rie" <rie@world.std.com>
Sender: owner-s-news@wubios.wustl.edu
Your desired transformation reverses the angle measurement
from increasing clockwise to increasing counter clockwise, so
you will want to use the negative of the input.  To rotate the zero
from top (North) to right (East), add 90 degrees to each 
measurement.  The modulo function will avoid results that are
negative or outside the 0-359.9999999 range.  Hence:
        NewAngle <-(450 - OldAngle)%%360
or
        NewAngle <-(90 - OldAngle)%%360
-----Original Message-----
From: Paul Schwarz <Paul.Schwarz@cornell.edu>
To: s-news@wubios.wustl.edu <s-news@wubios.wustl.edu>
Date: Monday, April 27, 1998 12:18 AM
Subject: [S] Transforming continuous variables


>.........
>For example, I've been working with slope aspect (again) which is coded in
>degrees from 0--360.  I'd like to transform this variable into a range of
>values from -90--90 in which 0/360 degrees (North) is transformed to +90,
>90 and 270 degrees (E & W) are transformed to 0 and 180 degrees (South) is
>transformed to -90.  I couldn't easily think of a one-liner that could do
>the transformation 
>Many thanks!
>

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>