R/plimacon.R

Defines functions plimacon

Documented in plimacon

#'@title creates a dataframe containing the points for the limacon mandala
#'@name plimacon
#'@author Luciane Ferreira Alcoforado
#
#'
#'@description  Function to build a limacon
#'@param theta is a vector length 2 with start angle and end angle
#'@param raio is a vector length 1 with radius value
#'@param k is a vector of length 1 with angles in degree to rotate the point (x,y)
#'@param n is a number of points
#'@return Returns a dataframe with the original points plus the respective rotations of these points.
#'@examples
#'theta = c(0,2*pi)
#'k=45
#'raio = 1
#'n=20
#'plimacon(theta, raio, k, n)
#'

#'@export
#'

plimacon = function(theta, raio, k, n){
theta = seq(theta[1],theta[2],length.out=n)
x=raio*cos(theta)-raio*cos(2*theta)
y=raio*sin(theta)-raio*sin(2*theta)
dt0=f_trans(x,y,t=c(-1,-2),1) #fixei a translação, pode ser modificado futuramente
x=dt0$x
y=dt0$y

rotacao = seq(k*pi/180,2*pi, length.out=floor(360/k))

dt=f_rotacao(x,y,rotacao)

return(dt)}

Try the MandalaR package in your browser

Any scripts or data that you put into this service are public.

MandalaR documentation built on Nov. 3, 2022, 1:05 a.m.