Published
Edited
Jan 26, 2021
Also listed in…
CAP 4720 2021
Ray Tracing
Insert cell
Insert cell
viewof N = slider({ min: 1, max: 200, step: 1, value: 20 })
Insert cell
Insert cell
Insert cell
md`### Visualization related definitions`
Insert cell
scale = (p)=>[xScale(p[0]),yScale(p[1])]
Insert cell
scale([2, 3])
Insert cell
windowAspect = width / height
Insert cell
yScale = d3.scaleLinear().domain([-10, 10]).range([height, 0])
Insert cell
xScale = d3.scaleLinear().domain([-10*windowAspect, 10*windowAspect]).range([0, width])
Insert cell
Insert cell
scene.spheres.map(d => ({
txt: `translate(${xScale(d.x)},${yScale(d.y)})`,
r: xScale(d.x + d.r) - xScale(d.x)
}))
Insert cell
Insert cell
scene.spheres
Insert cell
md`### External Libraries and Tools`
Insert cell
arrowhead
Insert cell
import { arrowhead} from "@harrystevens/linear-algebra"
Insert cell
//import {rangeSlider, themes} from '@mootari/range-slider'
Insert cell
import { slider } from "@jashkenas/inputs"
Insert cell
d3 = require("d3")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more