Mark Wickens

REC

Purpose

Converts polar coordinates (π‘₯,𝑦) to polar coordinates (π‘Ÿ,πœƒ).

Format

REC         ( distance π‘Ÿ    , angle πœƒ )
              β””β”€β”€β”€β”€β”¬β”€β”€β”€β”˜     β””β”€β”€β”€β”¬β”€β”€β”˜ 
         Numeric expression  Numeric expression

Example

REC(10,15)

Parameters

Explanation

  1. Converts polar coordinates (π‘Ÿ,πœƒ) to rectangular coordinates (π‘₯,𝑦). The following relational expressions are used at this time:

    π‘₯ = π‘Ÿ cos πœƒ, 𝑦 = π‘Ÿ sin πœƒ

  2. The value of π‘₯ is automatically assigned to variable X, while 𝑦 is automatically assigned to variable Y.

Sample Program

10  A=2 : B=30
20  Z=REC(A,B)
30  PRINT X; Y

Converts polar coordinates (2,30) to rectangular coordinates.