# Plot an implicit function containing the correlation of two vectors

I am trying to do something like this:

ContourPlot3D[
Expand[Correlation[{0, 1, 2}, {b1, b2, b3}] == .5], {b1, -5,
5}, {b2, -5, 5}, {b3, -10, 10}]


But apparently this make the computer freeze.

-
It works fine for me; it might be faster to plot expr = Re[Correlation[{0, 1, 2}, {b1, b2, b3}]] though. –  b.gatessucks Sep 1 '13 at 15:37
Or get rid of Expand and add Evaluated->True –  ssch Sep 1 '13 at 15:39
@b.gatessucks Could you please type out the whole command here? Thanks! –  qed Sep 1 '13 at 15:40
ContourPlot3D[ expr == .5], {b1, -5, 5}, {b2, -5, 5}, {b3, -10, 10}]. –  b.gatessucks Sep 1 '13 at 15:52
I found your solution faster than the one proposed in the answer. Could you please post it as an answer? –  qed Sep 1 '13 at 18:55

f[b1_, b2_, b3_] = FullSimplify[Correlation[{0, 1, 2}, {b1, b2, b3}],
Assumptions -> {b1, b2, b3} \[Element] Reals]


The plot. Teared edge is where singularity happens. Stripes help you to see where the slope is steeper.

ContourPlot3D[
f[b1, b2, b3] == .5, {b1, -5, 5}, {b2, -5, 5}, {b3, -10, 10},
MeshFunctions -> {#3 &}, MeshShading -> {Red, Automatic},
ContourStyle -> Directive[Opacity[0.5], Yellow]]


-