[R] Writing my 3D plot function

Alaios alaios at yahoo.com
Sun Jun 25 20:42:26 CEST 2017

```Hi all,I had a question last week on asking for a function that will help me draw three different circles on x,y,z axis based on polar coordinates (Each X,Y,Z circle are coming from three independent measurements of 1-360 polar coordinates). It turned out that there  is no such function in R and thus I am trying to write my own piece of code that hopefully I will be able to share. I have spent some time to write some code based on the rgl library (Still not 100% sure that this was the best option).
My input are three polar circles X,Y,Z with a good example being the image belowhttps://www.mathworks.com/help/examples/antenna/win64/xxpolarpattern_helix.png

So for X axis my input is a 2D matrix [360,2] including a single measurement per each polar coordinate. The first thing I tried was to turn my polar coordinates to cartesian ones by writing two simple functions. This works so far and I was able to print three simple circles on 3d spaceb but the problem now are the legends I need to put that remain on cartesian coordinates. As you can see from the code below all circles should have radius 1 (in terms of simplicity) but unfortunately I have the cartesian coordinates legends that do not help on reading my Figure. You can help me by executing the code below

require("rgls")