title: plot points and hyperplane in 3d with R
body: <p>i already read various posts regarding my topic but could not manage to find a solution.</p>
  
  <p>I want to plot the points </p>
  
  <p><img src="https://i.stack.imgur.com/gpAwt.gif" alt="enter image description here"></p>
  
  <p>The Points A and C should be plotted with red color, and Point B with blue.</p>
  
  <p>Furthermore i want to plot the hyperplane H:</p>
  
  <p><img src="https://i.stack.imgur.com/fccVF.gif" alt="enter image description here"></p>
  
  <p>As far i have the following code wich (of course) does not produce the right output:</p>
  
  <pre><code>rm(list=ls(all=TRUE))
  require("plot3D")
  require("rgl")
  require("misc3d")
  
  
  x3&lt;-c(1,0,1)
  y3&lt;-c(- sqrt(2),0,sqrt(2))
  z3&lt;-c(1,1,1)
  
  color&lt;-c("red","blue","red")
  
  plot3d(x3,y3,z3, col="red")
  surface3d(x=0.5,y=NULL,z=NULL,normal_x=1,normal_y=0,normal_z=0)A(1/-sqrt(2)/1)
  B(0/0/1)
  C(1/sqrt(2)/1)
  </code></pre>
  
  <p>If you have any hints and suggestions you are very welcome!</p>