4
$\begingroup$

It's not hard to find multiple trigonometric functions of period $2\pi$ that added to self shifted by some constant offset result in a constant.

In classic pythagorean identity, you have

$$F(x)+F\left(x+\frac{\pi}{2} \right) = 1 $$

where $F(x)=\sin^2 x$

Or you can use symmetry of the sine wave and create

$F(x)+F(x+\pi ) = 0$

where $F(x) = \sin x$

Now what I'm looking for is a transformation of the sine function that while retaining the $2\pi$ period, gives you identity if repeated three times, with $\frac 2 3 \pi$ shift in each appearance:

$$F(x) + F\left(x + \frac 2 3 \pi \right) + F\left(x+\frac 4 3 \pi\right) = \mathrm{const}$$

Can you find such a function?

Reason and purpose:

I've been trying to develop a better RGB$<=>$HSV color space conversion - all the common ones use sawtooth style variant functions with variant equations, and I think using trigonometric functions could result in more smooth color passages, never mind much simpler algorithm.

  • 5
    $\sin(x) + \sin(x + 2\pi/3) + \sin (x + 4\pi/3) = 0$... I'm not sure if this is what you're looking for.2012-09-02
  • 0
    The problem with using something like this is that a constant _sum_ of the 3 coordinates is not really useful for making the output fit into the RGB cube. If you want to hit the entire cube (and only that), either the range or the interpretation of both the S and the V coordinates will have to vary with the hue in rather complex and non-smooth ways.2012-09-02
  • 0
    @HenningMakholm: Yes, it either won't cover the whole RGB cube or will exceed its borders, but that's a problem with the RGB cube and not with HSV model or my conversion; In RGB the most saturaded C, M and Y are less saturated than most saturated R, G and B; RGB doesn't really have a color wheel; it has a color hexagon, and trying to fit HSV (which is naturally inclined towards color wheel) into RGB's hexagonal nature is "clipping its wings". I choose to have a smooth transition over all hues at <85% saturation than suffer sharp transitions over all saturations.2012-09-02

2 Answers 2

4

$$ e^{i\theta} + e^{i(\theta+2\pi/3)} + e^{i(\theta+4\pi/3)} = 0. $$ (Draw the picture and this is obvious.)

Therefore, the sum of the three real parts is $0$.

2

Let $F(x)=\sin(ax+b)$ where a,b are indeterminate constants.

$F(x) + F\left(x + \frac 2 3 \pi \right) + F\left(x+\frac 4 3 \pi\right) $

$=\sin(ax+b)+\sin(a(x+\frac{2\pi}{3})+b)+\sin(a(x+\frac{4\pi}{3})+b)$

$=\sin(ax+b)+\sin(a(x+\frac{4\pi}{3})+b)+\sin(a(x+\frac{2\pi}{3})+b)$

$=(1+2\cos\frac{2\pi a}{3})\sin(a(x+\frac{2\pi}{3})+b)$

This expression can not be constant for all $x$ unless $1+2\cos\frac{2\pi a}{3}=0$

Or, $\cos\frac{2\pi a}{3}=-\frac{1}{2}=\cos\frac{2\pi}{3}$

$\implies \frac{2\pi a}{3}=2m\pi±\frac{2\pi}{3}$ where $m$ is an integer,

$\implies a=3m±1$

$F(x)=\sin(ax+b)$ where $a$ is an integer with $(a,3)=1$.

As $b$ is an indeterminate constant, we can have some other indeterminate constant $c=b-\frac{\pi}{2}$

$F(x)=\sin(ax+\frac{\pi}{2}+c)=\cos(ax+c)$