[{"data":1,"prerenderedAt":311},["ShallowReactive",2],{"branding":3,"navigation":11,"social":38,"\u002Fdocs\u002Fexamples\u002Fpoints-and-vectors":57,"\u002Fdocs\u002Fexamples\u002Fpoints-and-vectors-python":224,"\u002Fdocs\u002Fexamples\u002Fpoints-and-vectors-surround":225,"docs-navigation":232},{"id":4,"title":5,"description":6,"extension":7,"meta":8,"stem":9,"__hash__":10},"branding\u002Fbranding.yml","COMPAS","The Progressive Python Framework for AEC","yml",{},"branding","RZe_zlUXQhPN3ap5X6d0zUmiqalxe1ZFVRnIsmTB9VU",{"id":12,"title":13,"extension":7,"items":14,"meta":35,"stem":36,"__hash__":37},"navigation\u002Fnavigation.yml","Main Navigation",[15,19,23,27,31],{"label":16,"icon":17,"to":18},"Docs","i-heroicons-book-open","\u002Fdocs\u002Foverview\u002Fintroduction",{"label":20,"icon":21,"to":22},"Packages","i-heroicons-puzzle-piece","\u002Fpackages",{"label":24,"icon":25,"to":26},"Association","i-heroicons-users","\u002Fassociation",{"label":28,"to":29,"icon":30},"News","\u002Fnews","i-heroicons-newspaper",{"label":32,"icon":33,"to":34},"Forum","i-heroicons-chat-bubble-left-right","https:\u002F\u002Fforum.compas-framework.org\u002F",{},"navigation","0jaKadsuS1w-R-2CifQeF-7No6HqrVyF7jIP80oFYoM",{"id":39,"title":40,"extension":7,"items":41,"meta":54,"stem":55,"__hash__":56},"social\u002Fsocial.yml","Social Media",[42,46,50],{"label":43,"to":44,"icon":45},"GitHub","https:\u002F\u002Fgithub.com\u002Fcompas-dev","i-simple-icons-github",{"label":47,"to":48,"icon":49},"X","https:\u002F\u002Fx.com\u002Fcompas_dev","i-simple-icons-x",{"label":51,"to":52,"icon":53},"LinkedIn","https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fcompas-association","i-simple-icons-linkedin",{},"social","495juwkNU0wtE_8lwERDZNWQES5uWYuMK_Wa6cQ9Wxg",{"id":58,"title":59,"body":60,"description":216,"extension":217,"headline":218,"meta":219,"navigation":112,"path":220,"seo":221,"stem":222,"__hash__":223},"docs\u002Fdocs\u002F3.examples\u002F2.points-and-vectors.md","Points and vectors",{"type":61,"value":62,"toc":213},"minimark",[63,78,83,190,209],[64,65,66,67,71,72,77],"p",{},"Points are locations, vectors are directions with a length. This example builds both, uses the cross product to find a perpendicular direction, and shows everything as a point and lines. It needs ",[68,69,70],"code",{},"compas_viewer","; see ",[73,74,76],"a",{"href":75},"\u002Fdocs\u002Fexamples\u002Fbox","Making a box"," to install it.",[79,80,82],"h2",{"id":81},"the-script","The script",[84,85,91],"pre",{"className":86,"code":87,"filename":88,"language":89,"meta":90,"style":90},"language-python shiki shiki-themes github-dark","from compas.geometry import Line, Point, Vector\nfrom compas_viewer import Viewer\n\norigin = Point(0, 0, 0)\nu = Vector(1, 0, 0)\nv = Vector(1, 1, 0)\n\nw = u.cross(v)      # perpendicular to u and v\nangle = u.angle(v)  # radians\nprint(w, angle)\n\nviewer = Viewer()\nviewer.scene.add(origin)\nfor vector in (u, v, w):\n    viewer.scene.add(Line(origin, origin + vector))\nviewer.show()\n","points_and_vectors.py","python","",[68,92,93,101,107,114,120,126,132,137,143,149,155,160,166,172,178,184],{"__ignoreMap":90},[94,95,98],"span",{"class":96,"line":97},"line",1,[94,99,100],{},"from compas.geometry import Line, Point, Vector\n",[94,102,104],{"class":96,"line":103},2,[94,105,106],{},"from compas_viewer import Viewer\n",[94,108,110],{"class":96,"line":109},3,[94,111,113],{"emptyLinePlaceholder":112},true,"\n",[94,115,117],{"class":96,"line":116},4,[94,118,119],{},"origin = Point(0, 0, 0)\n",[94,121,123],{"class":96,"line":122},5,[94,124,125],{},"u = Vector(1, 0, 0)\n",[94,127,129],{"class":96,"line":128},6,[94,130,131],{},"v = Vector(1, 1, 0)\n",[94,133,135],{"class":96,"line":134},7,[94,136,113],{"emptyLinePlaceholder":112},[94,138,140],{"class":96,"line":139},8,[94,141,142],{},"w = u.cross(v)      # perpendicular to u and v\n",[94,144,146],{"class":96,"line":145},9,[94,147,148],{},"angle = u.angle(v)  # radians\n",[94,150,152],{"class":96,"line":151},10,[94,153,154],{},"print(w, angle)\n",[94,156,158],{"class":96,"line":157},11,[94,159,113],{"emptyLinePlaceholder":112},[94,161,163],{"class":96,"line":162},12,[94,164,165],{},"viewer = Viewer()\n",[94,167,169],{"class":96,"line":168},13,[94,170,171],{},"viewer.scene.add(origin)\n",[94,173,175],{"class":96,"line":174},14,[94,176,177],{},"for vector in (u, v, w):\n",[94,179,181],{"class":96,"line":180},15,[94,182,183],{},"    viewer.scene.add(Line(origin, origin + vector))\n",[94,185,187],{"class":96,"line":186},16,[94,188,189],{},"viewer.show()\n",[64,191,192,193,196,197,200,201,204,205,208],{},"A point plus a vector gives a point; a point minus a point gives a vector. ",[68,194,195],{},"cross"," returns a vector perpendicular to both inputs, here the world Z axis. ",[68,198,199],{},"dot",", ",[68,202,203],{},"angle"," and ",[68,206,207],{},"length"," cover the rest of everyday vector maths.",[210,211,212],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":90,"searchDepth":103,"depth":103,"links":214},[215],{"id":81,"depth":103,"text":82},"Build points and vectors, combine them, and show them in COMPAS Viewer","md","Examples",{},"\u002Fdocs\u002Fexamples\u002Fpoints-and-vectors",{"title":59,"description":216},"docs\u002F3.examples\u002F2.points-and-vectors","5u-9JJF5mn5EpGNfFwVoXSAfGkGS2UoMGj0viHPlfyY",null,[226,228],{"title":76,"path":75,"stem":227,"children":-1},"docs\u002F3.examples\u002F1.box",{"title":229,"path":230,"stem":231,"children":-1},"Planes and frames","\u002Fdocs\u002Fexamples\u002Fplanes-and-frames","docs\u002F3.examples\u002F3.planes-and-frames",[233],{"title":16,"path":234,"stem":235,"children":236,"page":262},"\u002Fdocs","docs",[237,263,293,301],{"title":238,"icon":239,"path":240,"stem":241,"children":242,"page":262},"Overview","i-heroicons-play","\u002Fdocs\u002Foverview","docs\u002F1.overview",[243,246,250,254,258],{"title":244,"path":18,"stem":245},"Introduction","docs\u002F1.overview\u002F1.introduction",{"title":247,"path":248,"stem":249},"Installation","\u002Fdocs\u002Foverview\u002Finstallation","docs\u002F1.overview\u002F2.installation",{"title":251,"path":252,"stem":253},"First Steps","\u002Fdocs\u002Foverview\u002Ffirst-steps","docs\u002F1.overview\u002F3.first-steps",{"title":255,"path":256,"stem":257},"What's Next","\u002Fdocs\u002Foverview\u002Fwhats-next","docs\u002F1.overview\u002F4.whats-next",{"title":259,"path":260,"stem":261},"Ecosystem","\u002Fdocs\u002Foverview\u002Fecosystem","docs\u002F1.overview\u002F5.ecosystem",false,{"title":264,"icon":265,"path":266,"stem":267,"children":268,"page":262},"Features","i-heroicons-sparkles-solid","\u002Fdocs\u002Ffeatures","docs\u002F2.features",[269,273,277,281,285,289],{"title":270,"path":271,"stem":272},"Robust Geometry Kernel","\u002Fdocs\u002Ffeatures\u002Fgeometry","docs\u002F2.features\u002F1.geometry",{"title":274,"path":275,"stem":276},"Flexible Data Models","\u002Fdocs\u002Ffeatures\u002Fdata","docs\u002F2.features\u002F2.data",{"title":278,"path":279,"stem":280},"Interoperability Across Tools","\u002Fdocs\u002Ffeatures\u002Finterop","docs\u002F2.features\u002F3.interop",{"title":282,"path":283,"stem":284},"Cross Platform","\u002Fdocs\u002Ffeatures\u002Fcross-platform","docs\u002F2.features\u002F4.cross-platform",{"title":286,"path":287,"stem":288},"Modular Extension Ecosystem","\u002Fdocs\u002Ffeatures\u002Fextensions","docs\u002F2.features\u002F5.extensions",{"title":290,"path":291,"stem":292},"Developer-Friendly Foundation","\u002Fdocs\u002Ffeatures\u002Fdevelopers","docs\u002F2.features\u002F6.developers",{"title":218,"icon":294,"path":295,"stem":296,"children":297,"page":262},"i-heroicons-beaker","\u002Fdocs\u002Fexamples","docs\u002F3.examples",[298,299,300],{"title":76,"path":75,"stem":227},{"title":59,"path":220,"stem":222},{"title":229,"path":230,"stem":231},{"title":302,"icon":303,"path":304,"stem":305,"children":306,"page":262},"Cite & Credit","i-heroicons-academic-cap","\u002Fdocs\u002Fcite","docs\u002F4.cite",[307],{"title":308,"path":309,"stem":310},"Show it on your project","\u002Fdocs\u002Fcite\u002Fshow-it-on-your-project","docs\u002F4.cite\u002F1.show-it-on-your-project",1791766077349]