What kernel function can be used to project data into a feature space that is a "circle"? I am working with cyclical data (Days 1-7, hours 1-24).  I want to project it into a feature space that can understand that 1 and 7 are close days and 1 and 24 are closer than 22 and 24, etc, and then I will do k-means clustering using kkmeans in R.
Does a Guassian RBF accomplish this? I suspect not.  If not, can someone help me think of a kernel, preferably one from this list (w/ modified parameters possibly) so I do not have to reprogram it?
rbfdot Radial Basis kernel "Gaussian"
polydot Polynomial kernel
vanilladot Linear kernel
tanhdot Hyperbolic tangent kernel
laplacedot Laplacian kernel
besseldot Bessel kernel
anovadot ANOVA RBF kernel
splinedot Spline kernel
stringdot String kernel

It seems like it might be something like (for days)
d(x,y) = min(d(x,y),d(x+7,y))
Is this possible to program into k-means package you think?  It seems difficult to modify as a lot is written in FORTRAN
 A: What about using a cyclical function such as say a sine wave as kernel? So your kernel transformation would be something like:
$
f = 24 \\
t = (x_1 - x_2)\\
k(x_1,x_2) = \sin(t * \pi / f)
$
Of course there is a sligth assymetry here between the distances, even better would be to use triangle wave function:
$
f=24 \\
t = (x_1 - x_2)\\
k(x_1,x_2) = | 2 t/f - \lfloor t/f + 0.5 \rfloor |
$
Which reveals the following  graph when plotting similarity for say hour 0:

Code to generate this plot in python:
import matplotlib as plt
import numpy as np

def kernel1(x1,x2):
    freq = 24.0 #hours
    t = x1-x2
    value = np.abs(np.sin(t*np.pi/freq))

    return value
def kernel2(x1,x2):
    a = 24.0
    t = (x1-x2)
    value = np.abs( 2.0* (t/a - np.floor(t/a + 0.5)) )    
    return value 

hours = np.array(range(0,47))
hourtocompareto = 0
similarities1 = [kernel1(hourtocompareto,hour) for hour in hours]
similarities2 = [kernel2(hourtocompareto,hour) for hour in hours]

plt.plot(hours,similarities1,color="blue")
plt.plot(hours,similarities2,color="red")
plt.ylabel('Similarity')
plt.xlabel('Lag')
plt.show()

