Published
Edited
Apr 21, 2020
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[1],[],[],[]], [[1],[],[],[]], [2,3] ] )
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[1],[1],[],[]], [[1],[],[],[]], [1,2] ] )
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[1],[,1],[],[]], [[1],[],[],[]], [1,1] ] )
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[1],[1,1],[],[]], [[1],[],[],[]], [1,1] ] )
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [
[[1,0,1],[1,0,1],[0,0,1],[0,0,1]],
[[1,0,1],[1,0,1],[0,0,1],[0,0,1]],
[1,1,1]
] )
Insert cell
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[1],[,1],[1],[]], [[1],[],[],[]], [1,1] ] )
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [ [[,1],[,1],[1],[]], [[1],[],[],[]], [1,1] ] )
Insert cell
rotated4dViewOriginal( this, fourD_120_cell, [
[[1,0,1],[-1,1,1],[0,0,1],[0,0,1]],
[[1,0,1],[0,-1,1],[0,0,1],[0,0,1]],
[1,1,1]
] )

Insert cell
Insert cell
Insert cell
Insert cell
function rotated4dView( existingElement, polytope_4d, rotor, scale, config={} ) {
let halfWidth = width/2
let { height=300, svgWidth=halfWidth, renderWidth=halfWidth, orbitControl=true, solidStyle=true } = config
console.log("solidStyle");
console.log(solidStyle);
const solidParts = new Geometries( solidStyle ? icosahedral_solid_connectors_shapes : icosahedral_lifelike_connectors_shapes, vZome_colors )
const model = rotateAndProject( polytope_4d, rotor, scale )
const group = meshGroup( model, solidParts )

const cameraConfig = Object.assign({}, { aspect:8/5 }, config.camera)
const view4d = reusable3dCanvas( existingElement && existingElement.vZomeCanvas, group,
{ renderWidth:renderWidth, camera: cameraConfig } )
view4d.style.display = 'inline'
view4d.style['vertical-align'] = 'top'

const triangleConfig = Object.assign( {}, config, { orbits:getUsedOrbits(model), svgWidth:svgWidth, height } )
const triangle = icosaOrbitsTriangle( triangleConfig )
triangle.style.display = 'inline'
triangle.style['vertical-align'] = 'top'
const element = orbitControl? html`${view4d}${triangle}` : html`${view4d}`
element.vZomeCanvas = view4d
// element.style.display = 'inline'
// element.style['vertical-align'] = 'top'
return element;
}
Insert cell
function rotated4dViewNoOrbit( existingElement, polytope_4d, rotor, scale, config ) {
const newConfig = Object.assign( {}, config, { orbitControl: false } )
return rotated4dView( existingElement, polytope_4d, rotor, scale, newConfig )
}
Insert cell
rotated4dViewOriginal = function( existingElement, model, rotation, config ) {
const [ left, right, scale ] = rotation
return rotated4dView( existingElement, model, quaternionRotor( left, right ), scale, config )
}
Insert cell
Insert cell
quaternionRotor = function( left, right ) {
return function( v ) {
return quatmul( left, quatmul( v, right ) );
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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