0

What I've got

I'm setting up a scoring model for a Q&A-system and I'm implementing different score-distributions based on a scale from 0 to a given maximum value considering n cases. For instance, I managed to create a log (ln) curve as follows:

n_cases <- 5
val_max <- 10
val_step <- val_max/n_cases

plot(
  log(exp(val_max))*n_cases/c(1:n_cases) * (val_step/(n_cases-1)*(c(1:n_cases)-1)) / val_step
)

enter image description here

What I'm trying to do

However, now I'm trying to figure out how to get those values for a quarter circle such as in the log-example from above. This answer gives me an idea how to do it, but I didn't manage to get what I want.

This is what I've got currently, without an idea where to put the maximum value as trial & error didn't really give me a solution either:

plot(
  exp(pi * 1i * seq(0, 2, length.out = n_cases+1)[-1])
)

Thank you for your suggestions!

alex_555
  • 1,092
  • 1
  • 14
  • 27

1 Answers1

1

Something like this?:

n_cases <- 5
val_max <- 5
phi <- seq(pi/2, pi, length.out = n_cases)

x = val_max + val_max*cos(phi)
y = val_max*sin(phi)

plot(x, y)

enter image description here

Edit:

All I want is a vector of indizes between 0 and a given max value raising in a quarter-circle fashion.

Either you have constant x-distances or constant angle-distances:

x <- 0:5
r <- 5
y <- rev(sqrt(r^2-x^2))

plot(x, y)

enter image description here

ismirsehregal
  • 30,045
  • 5
  • 31
  • 78
  • Almost! It's still not a quarter circle as the values don't have the same distances. – alex_555 Jun 12 '19 at 14:01
  • Yes, that's it. However, the plot was just for visualization. What I still need is one value per index, so that I can use them in my model. – alex_555 Jun 12 '19 at 14:15
  • To create equidistant points spread on an integer index and a fixed y-maximum you'll need to use a line not a circle. – ismirsehregal Jun 13 '19 at 07:56
  • Ok, then I might have formulated my question wrong. All I want is a vector of indizes between 0 and a given max value raising in a quarter-circle fashion. – alex_555 Jun 13 '19 at 08:38
  • Ok thank you! It isn't really what I expected, but it solved the question. At least now I know what I want. Thanks! – alex_555 Jun 13 '19 at 09:32
  • The scenario you were asking for (constant x-distance and constant angle-distance) can't be realized with a circle equation. – ismirsehregal Jun 13 '19 at 09:41
  • 1
    You're right. That's probably why my brain wasn't able to come up with a meaningful solution prior to asking the question. – alex_555 Jun 13 '19 at 09:45