Published
Edited
Jan 28, 2019
Insert cell
Insert cell
Insert cell
Insert cell
vz([...kNnDataSet ,{height:69,weight:210,label:'YOU'}])
.x('weight')
.y('height')
.point({size: 75,"filled": true})
.width(700)
.height(700)
.color('label', 'n')
.plot()
Insert cell
k = [210,69]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
uKd = function(a,b)
{
const distance = ((a^2) + (b^2));
// not sure how to handle the square root of negative numbers
if (distance < 0 ) {
const distanceAsPositive = -1 * distance;
const squareRoot = Math.sqrt(distanceAsPositive);
const distanceAsNegative = -1 * squareRoot;
return distanceAsNegative
} else {
return Math.sqrt(distance);
}
//return isNaN(Math.sqrt(c)) ? 100 : Math.sqrt(c) ;

}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more