[{"data":1,"prerenderedAt":661},["ShallowReactive",2],{"articles-all":3,"/desarrollo/funciones/vec":419},[4,18,26,33,40,49,56,64,71,80,87,94,101,108,115,122,130,142,153,161,168,176,182,189,196,202,207,213,220,225,231,237,242,247,252,258,264,270,277,284,290,298,305,312,319,326,332,337,344,349,355,361,367,373,379,385,392,399,405,412],{"locale":5,"path":6,"title":7,"description":8,"cat":9,"catSlug":10,"tags":11,"icon":13,"updated":14,"words":15,"read":16,"stem":17},"es","/desarrollo/netlify/desplegar-proyecto","Desplegar un Proyecto","Aprende a desplegar tu proyecto en Netlify.","Nuxt/Sanity","desarrollo",[12],"netlify","i-lucide-cloud","2026-01-02",104,"2 min de lectura","1.desarrollo/1.netlify/1.desplegar-proyecto",{"locale":5,"path":19,"title":20,"description":21,"cat":9,"catSlug":10,"tags":22,"icon":13,"updated":23,"words":24,"read":16,"stem":25},"/desarrollo/netlify/configurar-hook-sanity","Deploy desde Sanity","Aprende a configurar un Build Hook en Netlify para lanzar deploys directamente desde Sanity Studio.",[12],"2026-01-13",103,"1.desarrollo/1.netlify/2.configurar-hook-sanity",{"locale":5,"path":27,"title":28,"description":29,"cat":9,"catSlug":10,"tags":30,"icon":13,"updated":23,"words":31,"read":16,"stem":32},"/desarrollo/netlify/configurar-pagina-preview","Configurar Página Preview","Aprende a configurar una página de preview usando Netlify y Sanity para visualizar cambios antes de producción.",[12],151,"1.desarrollo/1.netlify/3.configurar-pagina-preview",{"locale":5,"path":34,"title":35,"description":36,"cat":9,"catSlug":10,"tags":37,"icon":13,"updated":14,"words":38,"read":16,"stem":39},"/desarrollo/netlify/configurar-formulario","Configurar Formulario","Aprende a crear y usar formularios de Netlify",[12],280,"1.desarrollo/1.netlify/4.configurar-formulario",{"locale":5,"path":41,"title":42,"description":43,"cat":9,"catSlug":10,"tags":44,"icon":46,"updated":14,"words":47,"read":16,"stem":48},"/desarrollo/nuxt/introduccion","Introducción al Starter","En desarrollo...",[45],"nuxt","i-lucide-layers",2,"1.desarrollo/2.nuxt/1.introduccion",{"locale":5,"path":50,"title":51,"description":52,"cat":9,"catSlug":10,"tags":53,"icon":46,"updated":14,"words":54,"read":16,"stem":55},"/desarrollo/nuxt/preload","Font Preload","Para evitar el salto tipográfico mientras la fuente se carga, basta con activar el preload de las fuentes App.vue, en useHead:",[45],220,"1.desarrollo/2.nuxt/preload",{"locale":5,"path":57,"title":42,"description":58,"cat":9,"catSlug":10,"tags":59,"icon":61,"updated":14,"words":62,"read":16,"stem":63},"/desarrollo/sanity/introduccion","Aprende a configurar el deploy y página preview",[60],"sanity","i-lucide-database",31,"1.desarrollo/3.sanity/1.introduccion",{"locale":5,"path":65,"title":66,"description":67,"cat":9,"catSlug":10,"tags":68,"icon":61,"updated":14,"words":69,"read":16,"stem":70},"/desarrollo/sanity/preview-documentos","Configura el preview por documento","Aprende a configurar el preview de cada documento existente en tu proyecto",[60],162,"1.desarrollo/3.sanity/2.preview-documentos",{"locale":5,"path":72,"title":73,"description":74,"cat":9,"catSlug":10,"tags":75,"icon":77,"updated":14,"words":78,"read":16,"stem":79},"/desarrollo/funciones/clamp","clamp()","Limita un valor dentro de un rango específico para que nunca supere los límites.",[76],"funciones","i-lucide-square-function",134,"1.desarrollo/4.funciones/1.clamp",{"locale":5,"path":81,"title":82,"description":83,"cat":9,"catSlug":10,"tags":84,"icon":77,"updated":14,"words":85,"read":16,"stem":86},"/desarrollo/funciones/lerp","lerp()","Interpolación lineal clásica para acercar un valor inicial a uno final usando un factor alpha.",[76],149,"1.desarrollo/4.funciones/2.lerp",{"locale":5,"path":88,"title":89,"description":90,"cat":9,"catSlug":10,"tags":91,"icon":77,"updated":14,"words":92,"read":16,"stem":93},"/desarrollo/funciones/map","map()","Esta función se conoce comúnmente como función de mapeo lineal o remapeo de rangos.",[76],270,"1.desarrollo/4.funciones/3.map",{"locale":5,"path":95,"title":96,"description":97,"cat":9,"catSlug":10,"tags":98,"icon":77,"updated":14,"words":99,"read":16,"stem":100},"/desarrollo/funciones/mix","mix()","Interpola entre dos valores numéricos utilizando un factor alpha entre 0 y 1.",[76],141,"1.desarrollo/4.funciones/4.mix",{"locale":5,"path":102,"title":103,"description":104,"cat":9,"catSlug":10,"tags":105,"icon":77,"updated":14,"words":106,"read":16,"stem":107},"/desarrollo/funciones/smoothstep","smoothstep()","Produce una transición suave entre dos valores, ideal para animaciones sin saltos bruscos.",[76],173,"1.desarrollo/4.funciones/5.smoothstep",{"locale":5,"path":109,"title":110,"description":111,"cat":9,"catSlug":10,"tags":112,"icon":77,"updated":14,"words":113,"read":16,"stem":114},"/desarrollo/funciones/step","step()","Devuelve 0 o 1 dependiendo de si un valor supera un umbral determinado.",[76],114,"1.desarrollo/4.funciones/6.step",{"locale":5,"path":116,"title":117,"description":118,"cat":9,"catSlug":10,"tags":119,"icon":77,"updated":14,"words":120,"read":16,"stem":121},"/desarrollo/funciones/truncatedecimals","truncateDecimals()","Corta un número al número de decimales solicitado sin realizar redondeos.",[76],122,"1.desarrollo/4.funciones/7.truncateDecimals",{"locale":5,"path":123,"title":124,"description":125,"cat":9,"catSlug":10,"tags":126,"icon":77,"updated":14,"words":127,"read":128,"stem":129},"/desarrollo/funciones/vec","Vec","Clase utilitaria para trabajar con vectores 2D y 3D y realizar operaciones comunes.",[76],507,"3 min de lectura","1.desarrollo/4.funciones/8.vec",{"locale":5,"path":131,"title":132,"description":133,"cat":134,"catSlug":135,"tags":136,"icon":138,"updated":139,"words":140,"read":16,"stem":141},"/shopify/admin/colaboradores-externos","Colaboradores externos","Cómo añadir colaboradores externos en Shopify","Shopify","shopify",[137],"admin","i-lucide-settings","2026-09-25",6,"2.shopify/1.admin/1.colaboradores-externos",{"locale":5,"path":143,"title":144,"description":145,"cat":146,"catSlug":147,"tags":148,"icon":149,"updated":150,"words":151,"read":16,"stem":152},"/holded/fichaje","Fichaje horario","Aprende a iniciar y detener el cronómetro para registrar tu tiempo de manera precisa","Holded","holded",[147],"i-lucide-clock","2026-01-08",43,"3.holded/1.fichaje",{"locale":5,"path":154,"title":155,"description":156,"cat":146,"catSlug":147,"tags":157,"icon":149,"updated":158,"words":159,"read":16,"stem":160},"/holded/proyectos-tareas-horas","Horas proyectos","Crear proyectos y registrar tareas de forma eficiente",[147],"2026-01-22",34,"3.holded/2.proyectos-tareas-horas",{"locale":5,"path":162,"title":163,"description":164,"cat":146,"catSlug":147,"tags":165,"icon":149,"updated":14,"words":166,"read":16,"stem":167},"/holded/vacaciones","Vacaciones","Aprende a solicitar días libres y consultar tu historial de ausencias",[147],42,"3.holded/3.vacaciones",{"locale":169,"path":170,"title":171,"description":172,"cat":9,"catSlug":10,"tags":173,"icon":13,"updated":14,"words":174,"read":16,"stem":175},"ca","/ca/desarrollo/netlify/desplegar-proyecto","Desplegar un projecte","Aprèn a desplegar el teu projecte a Netlify.",[12],108,"ca/1.desarrollo/1.netlify/1.desplegar-proyecto",{"locale":169,"path":177,"title":178,"description":179,"cat":9,"catSlug":10,"tags":180,"icon":13,"updated":23,"words":15,"read":16,"stem":181},"/ca/desarrollo/netlify/configurar-hook-sanity","Deploy des de Sanity","Aprèn a configurar un Build Hook a Netlify per llançar deploys directament des de Sanity Studio.",[12],"ca/1.desarrollo/1.netlify/2.configurar-hook-sanity",{"locale":169,"path":183,"title":184,"description":185,"cat":9,"catSlug":10,"tags":186,"icon":13,"updated":23,"words":187,"read":16,"stem":188},"/ca/desarrollo/netlify/configurar-pagina-preview","Configurar la pàgina de preview","Aprèn a configurar una pàgina de preview amb Netlify i Sanity per visualitzar canvis abans de producció.",[12],153,"ca/1.desarrollo/1.netlify/3.configurar-pagina-preview",{"locale":169,"path":190,"title":191,"description":192,"cat":9,"catSlug":10,"tags":193,"icon":13,"updated":14,"words":194,"read":16,"stem":195},"/ca/desarrollo/netlify/configurar-formulario","Configurar formularis","Aprèn a crear i utilitzar formularis de Netlify",[12],276,"ca/1.desarrollo/1.netlify/4.configurar-formulario",{"locale":169,"path":197,"title":198,"description":199,"cat":9,"catSlug":10,"tags":200,"icon":46,"updated":14,"words":47,"read":16,"stem":201},"/ca/desarrollo/nuxt/introduccion","Introducció a l'Starter","En desenvolupament...",[45],"ca/1.desarrollo/2.nuxt/1.introduccion",{"locale":169,"path":203,"title":51,"description":204,"cat":9,"catSlug":10,"tags":205,"icon":46,"updated":14,"words":54,"read":16,"stem":206},"/ca/desarrollo/nuxt/preload","Per evitar el salt tipogràfic mentre la font es carrega, n'hi ha prou amb activar el preload de les fonts a App.vue, a useHead:",[45],"ca/1.desarrollo/2.nuxt/preload",{"locale":169,"path":208,"title":198,"description":209,"cat":9,"catSlug":10,"tags":210,"icon":61,"updated":14,"words":211,"read":16,"stem":212},"/ca/desarrollo/sanity/introduccion","Aprèn a configurar el deploy i la pàgina de preview",[60],33,"ca/1.desarrollo/3.sanity/1.introduccion",{"locale":169,"path":214,"title":215,"description":216,"cat":9,"catSlug":10,"tags":217,"icon":61,"updated":14,"words":218,"read":16,"stem":219},"/ca/desarrollo/sanity/preview-documentos","Configura la preview per document","Aprèn a configurar la preview de cada document existent al teu projecte",[60],163,"ca/1.desarrollo/3.sanity/2.preview-documentos",{"locale":169,"path":221,"title":73,"description":222,"cat":9,"catSlug":10,"tags":223,"icon":77,"updated":14,"words":78,"read":16,"stem":224},"/ca/desarrollo/funciones/clamp","Limita un valor dins d'un rang específic perquè no superi mai els límits.",[76],"ca/1.desarrollo/4.funciones/1.clamp",{"locale":169,"path":226,"title":82,"description":227,"cat":9,"catSlug":10,"tags":228,"icon":77,"updated":14,"words":229,"read":16,"stem":230},"/ca/desarrollo/funciones/lerp","Interpolació lineal clàssica per acostar un valor inicial a un de final amb un factor alpha.",[76],148,"ca/1.desarrollo/4.funciones/2.lerp",{"locale":169,"path":232,"title":89,"description":233,"cat":9,"catSlug":10,"tags":234,"icon":77,"updated":14,"words":235,"read":16,"stem":236},"/ca/desarrollo/funciones/map","Aquesta funció es coneix comunament com a funció de mapatge lineal o de reescalat de rangs.",[76],262,"ca/1.desarrollo/4.funciones/3.map",{"locale":169,"path":238,"title":96,"description":239,"cat":9,"catSlug":10,"tags":240,"icon":77,"updated":14,"words":99,"read":16,"stem":241},"/ca/desarrollo/funciones/mix","Interpola entre dos valors numèrics amb un factor alpha entre 0 i 1.",[76],"ca/1.desarrollo/4.funciones/4.mix",{"locale":169,"path":243,"title":103,"description":244,"cat":9,"catSlug":10,"tags":245,"icon":77,"updated":14,"words":106,"read":16,"stem":246},"/ca/desarrollo/funciones/smoothstep","Produeix una transició suau entre dos valors, ideal per a animacions sense salts bruscos.",[76],"ca/1.desarrollo/4.funciones/5.smoothstep",{"locale":169,"path":248,"title":110,"description":249,"cat":9,"catSlug":10,"tags":250,"icon":77,"updated":14,"words":113,"read":16,"stem":251},"/ca/desarrollo/funciones/step","Retorna 0 o 1 segons si un valor supera un llindar determinat.",[76],"ca/1.desarrollo/4.funciones/6.step",{"locale":169,"path":253,"title":117,"description":254,"cat":9,"catSlug":10,"tags":255,"icon":77,"updated":14,"words":256,"read":16,"stem":257},"/ca/desarrollo/funciones/truncatedecimals","Trunca un nombre al nombre de decimals sol·licitat sense arrodonir.",[76],123,"ca/1.desarrollo/4.funciones/7.truncateDecimals",{"locale":169,"path":259,"title":124,"description":260,"cat":9,"catSlug":10,"tags":261,"icon":77,"updated":14,"words":262,"read":128,"stem":263},"/ca/desarrollo/funciones/vec","Classe utilitària per treballar amb vectors 2D i 3D i fer operacions comunes.",[76],508,"ca/1.desarrollo/4.funciones/8.vec",{"locale":169,"path":265,"title":266,"description":267,"cat":134,"catSlug":135,"tags":268,"icon":138,"updated":139,"words":140,"read":16,"stem":269},"/ca/shopify/admin/colaboradores-externos","Col·laboradors externs","Com afegir col·laboradors externs a Shopify",[137],"ca/2.shopify/1.admin/1.colaboradores-externos",{"locale":169,"path":271,"title":272,"description":273,"cat":146,"catSlug":147,"tags":274,"icon":149,"updated":150,"words":275,"read":16,"stem":276},"/ca/holded/fichaje","Fitxatge horari","Aprèn a iniciar i aturar el cronòmetre per registrar el teu temps amb precisió",[147],41,"ca/3.holded/1.fichaje",{"locale":169,"path":278,"title":279,"description":280,"cat":146,"catSlug":147,"tags":281,"icon":149,"updated":158,"words":282,"read":16,"stem":283},"/ca/holded/proyectos-tareas-horas","Hores de projectes","Crea projectes i registra tasques de manera eficient",[147],37,"ca/3.holded/2.proyectos-tareas-horas",{"locale":169,"path":285,"title":286,"description":287,"cat":146,"catSlug":147,"tags":288,"icon":149,"updated":14,"words":166,"read":16,"stem":289},"/ca/holded/vacaciones","Vacances","Aprèn a sol·licitar dies lliures i consultar el teu historial d'absències",[147],"ca/3.holded/3.vacaciones",{"locale":291,"path":292,"title":293,"description":294,"cat":9,"catSlug":10,"tags":295,"icon":13,"updated":14,"words":15,"read":296,"stem":297},"en","/en/desarrollo/netlify/desplegar-proyecto","Deploy a Project","Learn how to deploy your project on Netlify.",[12],"2 min read","en/1.desarrollo/1.netlify/1.desplegar-proyecto",{"locale":291,"path":299,"title":300,"description":301,"cat":9,"catSlug":10,"tags":302,"icon":13,"updated":23,"words":303,"read":296,"stem":304},"/en/desarrollo/netlify/configurar-hook-sanity","Deploy from Sanity","Learn how to set up a Build Hook in Netlify to trigger deploys directly from Sanity Studio.",[12],99,"en/1.desarrollo/1.netlify/2.configurar-hook-sanity",{"locale":291,"path":306,"title":307,"description":308,"cat":9,"catSlug":10,"tags":309,"icon":13,"updated":23,"words":310,"read":296,"stem":311},"/en/desarrollo/netlify/configurar-pagina-preview","Set Up Preview Page","Learn how to set up a preview page using Netlify and Sanity to review changes before production.",[12],142,"en/1.desarrollo/1.netlify/3.configurar-pagina-preview",{"locale":291,"path":313,"title":314,"description":315,"cat":9,"catSlug":10,"tags":316,"icon":13,"updated":14,"words":317,"read":296,"stem":318},"/en/desarrollo/netlify/configurar-formulario","Set Up Forms","Learn how to create and use Netlify forms",[12],259,"en/1.desarrollo/1.netlify/4.configurar-formulario",{"locale":291,"path":320,"title":321,"description":322,"cat":9,"catSlug":10,"tags":323,"icon":46,"updated":14,"words":324,"read":296,"stem":325},"/en/desarrollo/nuxt/introduccion","Starter Introduction","Work in progress...",[45],3,"en/1.desarrollo/2.nuxt/1.introduccion",{"locale":291,"path":327,"title":51,"description":328,"cat":9,"catSlug":10,"tags":329,"icon":46,"updated":14,"words":330,"read":296,"stem":331},"/en/desarrollo/nuxt/preload","To avoid the typographic jump while the font loads, just enable font preloading in App.vue, in useHead:",[45],206,"en/1.desarrollo/2.nuxt/preload",{"locale":291,"path":333,"title":321,"description":334,"cat":9,"catSlug":10,"tags":335,"icon":61,"updated":14,"words":211,"read":296,"stem":336},"/en/desarrollo/sanity/introduccion","Learn how to set up the deploy and preview page",[60],"en/1.desarrollo/3.sanity/1.introduccion",{"locale":291,"path":338,"title":339,"description":340,"cat":9,"catSlug":10,"tags":341,"icon":61,"updated":14,"words":342,"read":296,"stem":343},"/en/desarrollo/sanity/preview-documentos","Set Up Per-Document Preview","Learn how to set up preview for each existing document in your project",[60],154,"en/1.desarrollo/3.sanity/2.preview-documentos",{"locale":291,"path":345,"title":73,"description":346,"cat":9,"catSlug":10,"tags":347,"icon":77,"updated":14,"words":78,"read":296,"stem":348},"/en/desarrollo/funciones/clamp","Clamps a value within a specific range so it never exceeds the limits.",[76],"en/1.desarrollo/4.funciones/1.clamp",{"locale":291,"path":350,"title":82,"description":351,"cat":9,"catSlug":10,"tags":352,"icon":77,"updated":14,"words":353,"read":296,"stem":354},"/en/desarrollo/funciones/lerp","Classic linear interpolation to ease an initial value toward a final one using an alpha factor.",[76],147,"en/1.desarrollo/4.funciones/2.lerp",{"locale":291,"path":356,"title":89,"description":357,"cat":9,"catSlug":10,"tags":358,"icon":77,"updated":14,"words":359,"read":296,"stem":360},"/en/desarrollo/funciones/map","This function is commonly known as a linear mapping or range remapping function.",[76],260,"en/1.desarrollo/4.funciones/3.map",{"locale":291,"path":362,"title":96,"description":363,"cat":9,"catSlug":10,"tags":364,"icon":77,"updated":14,"words":365,"read":296,"stem":366},"/en/desarrollo/funciones/mix","Interpolates between two numeric values using an alpha factor between 0 and 1.",[76],139,"en/1.desarrollo/4.funciones/4.mix",{"locale":291,"path":368,"title":103,"description":369,"cat":9,"catSlug":10,"tags":370,"icon":77,"updated":14,"words":371,"read":296,"stem":372},"/en/desarrollo/funciones/smoothstep","Produces a smooth transition between two values, ideal for animation without abrupt jumps.",[76],171,"en/1.desarrollo/4.funciones/5.smoothstep",{"locale":291,"path":374,"title":110,"description":375,"cat":9,"catSlug":10,"tags":376,"icon":77,"updated":14,"words":377,"read":296,"stem":378},"/en/desarrollo/funciones/step","Returns 0 or 1 depending on whether a value exceeds a given threshold.",[76],112,"en/1.desarrollo/4.funciones/6.step",{"locale":291,"path":380,"title":117,"description":381,"cat":9,"catSlug":10,"tags":382,"icon":77,"updated":14,"words":383,"read":296,"stem":384},"/en/desarrollo/funciones/truncatedecimals","Truncates a number to the requested decimal places without rounding.",[76],119,"en/1.desarrollo/4.funciones/7.truncateDecimals",{"locale":291,"path":386,"title":124,"description":387,"cat":9,"catSlug":10,"tags":388,"icon":77,"updated":14,"words":389,"read":390,"stem":391},"/en/desarrollo/funciones/vec","Utility class for working with 2D and 3D vectors and performing common operations.",[76],510,"3 min read","en/1.desarrollo/4.funciones/8.vec",{"locale":291,"path":393,"title":394,"description":395,"cat":134,"catSlug":135,"tags":396,"icon":138,"updated":139,"words":397,"read":296,"stem":398},"/en/shopify/admin/colaboradores-externos","External Collaborators","How to add external collaborators in Shopify",[137],7,"en/2.shopify/1.admin/1.colaboradores-externos",{"locale":291,"path":400,"title":401,"description":402,"cat":146,"catSlug":147,"tags":403,"icon":149,"updated":150,"words":282,"read":296,"stem":404},"/en/holded/fichaje","Time Tracking","Learn how to start and stop the timer to log your time accurately",[147],"en/3.holded/1.fichaje",{"locale":291,"path":406,"title":407,"description":408,"cat":146,"catSlug":147,"tags":409,"icon":149,"updated":158,"words":410,"read":296,"stem":411},"/en/holded/proyectos-tareas-horas","Project Hours","Create projects and log tasks efficiently",[147],36,"en/3.holded/2.proyectos-tareas-horas",{"locale":291,"path":413,"title":414,"description":415,"cat":146,"catSlug":147,"tags":416,"icon":149,"updated":14,"words":417,"read":296,"stem":418},"/en/holded/vacaciones","Time Off","Learn how to request days off and check your absence history",[147],39,"en/3.holded/3.vacaciones",{"id":420,"title":124,"body":421,"description":125,"extension":655,"icon":656,"meta":657,"navigation":658,"path":123,"seo":659,"stem":129,"tags":656,"updated":14,"__hash__":660},"docs/1.desarrollo/4.funciones/8.vec.md",{"type":422,"value":423,"toc":648},"minimark",[424,429,440,444,494,498,638,642],[425,426,428],"h2",{"id":427},"código","Código",[430,431,437],"pre",{"className":432,"code":434,"language":435,"meta":436},[433],"language-ts","export class Vec {\n    x: number\n    y: number\n    z: number\n\n    constructor(x: number = 0, y: number = 0, z: number = 0) {\n        this.x = x\n        this.y = y\n        this.z = z\n    }\n\n    copy(v: Vec): Vec {\n        this.x = v.x\n        this.y = v.y\n        this.z = v.z\n        return this\n    }\n\n    set(x: number, y: number, z: number = 0): Vec {\n        this.x = x\n        this.y = y\n        this.z = z\n\n        return this\n    }\n\n    clone(): Vec {\n        return new Vec(this.x, this.y, this.z)\n    }\n\n    add(v: Vec): Vec {\n        this.x += v.x\n        this.y += v.y\n        this.z += v.z\n\n        return this\n    }\n\n    sub(v: Vec): Vec {\n        this.x -= v.x\n        this.y -= v.y\n        this.z -= v.z\n\n        return this\n    }\n\n    mul(v: Vec): Vec {\n        this.x *= v.x\n        this.y *= v.y\n        this.z *= v.z\n\n        return this\n    }\n\n    div(v: Vec): Vec {\n        this.x /= v.x\n        this.y /= v.y\n        this.z /= v.z\n\n        return this\n    }\n\n    scale(scl: number): Vec {\n        this.x *= scl\n        this.y *= scl\n        this.z *= scl\n\n        return this\n    }\n\n    length(): number {\n        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)\n    }\n\n    lerp(target: Vec, alpha: number): Vec {\n        this.x = MathUtils.lerp(this.x, target.x, alpha)\n        this.y = MathUtils.lerp(this.y, target.y, alpha)\n        this.z = MathUtils.lerp(this.z, target.z, alpha)\n\n        return this\n    }\n\n    equals(v: Vec): boolean {\n        return this.x === v.x && this.y === v.y && this.z === v.z\n    }\n\n    dot(v: Vec): number {\n        return this.x * v.x + this.y * v.y + this.z * v.z\n    }\n\n    distanceTo(v: Vec): number {\n        return this.clone().sub(v).length()\n    }\n\n    normalize(): Vec {\n        const L = this.length()\n        if (L === 0) return this\n\n        this.x /= L\n        this.y /= L\n        this.z /= L\n\n        return this\n    }\n}\n","ts","",[438,439,434],"code",{"__ignoreMap":436},[425,441,443],{"id":442},"propiedades","Propiedades",[445,446,447,460],"table",{},[448,449,450],"thead",{},[451,452,453,457],"tr",{},[454,455,456],"th",{},"Propiedad",[454,458,459],{},"Descripción",[461,462,463,474,484],"tbody",{},[451,464,465,471],{},[466,467,468],"td",{},[438,469,470],{},"x",[466,472,473],{},"Componente horizontal del vector.",[451,475,476,481],{},[466,477,478],{},[438,479,480],{},"y",[466,482,483],{},"Componente vertical del vector.",[451,485,486,491],{},[466,487,488],{},[438,489,490],{},"z",[466,492,493],{},"Componente de profundidad (opcional).",[425,495,497],{"id":496},"métodos-principales","Métodos principales",[445,499,500,509],{},[448,501,502],{},[451,503,504,507],{},[454,505,506],{},"Método",[454,508,459],{},[461,510,511,521,531,541,555,568,578,588,598,608,618,628],{},[451,512,513,518],{},[466,514,515],{},[438,516,517],{},"copy(v)",[466,519,520],{},"Copia los valores de otro vector.",[451,522,523,528],{},[466,524,525],{},[438,526,527],{},"set(x, y, z)",[466,529,530],{},"Asigna nuevos valores rápidamente.",[451,532,533,538],{},[466,534,535],{},[438,536,537],{},"clone()",[466,539,540],{},"Devuelve una copia del vector actual.",[451,542,543,552],{},[466,544,545,548,549],{},[438,546,547],{},"add(v)"," / ",[438,550,551],{},"sub(v)",[466,553,554],{},"Suma o resta otro vector.",[451,556,557,565],{},[466,558,559,548,562],{},[438,560,561],{},"mul(v)",[438,563,564],{},"div(v)",[466,566,567],{},"Multiplica o divide componente a componente.",[451,569,570,575],{},[466,571,572],{},[438,573,574],{},"scale(s)",[466,576,577],{},"Escala el vector por un escalar.",[451,579,580,585],{},[466,581,582],{},[438,583,584],{},"length()",[466,586,587],{},"Regresa la magnitud del vector.",[451,589,590,595],{},[466,591,592],{},[438,593,594],{},"lerp(target, alpha)",[466,596,597],{},"Interpola entre el vector actual y el objetivo.",[451,599,600,605],{},[466,601,602],{},[438,603,604],{},"equals(v)",[466,606,607],{},"Compara si ambos vectores son idénticos.",[451,609,610,615],{},[466,611,612],{},[438,613,614],{},"dot(v)",[466,616,617],{},"Calcula el producto punto.",[451,619,620,625],{},[466,621,622],{},[438,623,624],{},"distanceTo(v)",[466,626,627],{},"Distancia entre dos vectores.",[451,629,630,635],{},[466,631,632],{},[438,633,634],{},"normalize()",[466,636,637],{},"Normaliza el vector para que su longitud sea 1.",[425,639,641],{"id":640},"ejemplo-en-nuxt","Ejemplo en Nuxt",[430,643,646],{"className":644,"code":645,"language":435,"meta":436},[433],"\u003Cscript setup lang=\"ts\">\n// Puedes colocar la clase en ~/utils/math/vec.ts e importarla aquí.\nimport { Vec } from '~/utils/math/vec'\n\nconst pointer = ref(new Vec())\nconst target = new Vec()\nlet frame: number | null = null\n\nconst animate = () => {\n  pointer.value.lerp(target, 0.15)\n  frame = requestAnimationFrame(animate)\n}\n\nconst handlePointer = (event: PointerEvent) => {\n  target.set(event.clientX, event.clientY)\n}\n\nconst styleCursor = computed(() => ({\n  transform: `translate3d(${pointer.value.x}px, ${pointer.value.y}px, 0)`\n}))\n\nonMounted(() => {\n  window.addEventListener('pointermove', handlePointer)\n  frame = requestAnimationFrame(animate)\n})\n\nonUnmounted(() => {\n  window.removeEventListener('pointermove', handlePointer)\n  if (frame) cancelAnimationFrame(frame)\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003Cdiv class=\"cursor\" :style=\"styleCursor\">Vec\u003C/div>\n\u003C/template>\n\n\u003Cstyle scoped>\n.cursor {\n  position: fixed;\n  inset: 0;\n  width: 60px;\n  aspect-ratio: 1;\n  display: grid;\n  place-items: center;\n  background: rgba(37, 99, 235, 0.2);\n  border: 1px solid #2563eb;\n  border-radius: 999px;\n  pointer-events: none;\n  font-weight: 600;\n}\n\u003C/style>\n",[438,647,645],{"__ignoreMap":436},{"title":436,"searchDepth":649,"depth":47,"links":650},1,[651,652,653,654],{"id":427,"depth":47,"text":428},{"id":442,"depth":47,"text":443},{"id":496,"depth":47,"text":497},{"id":640,"depth":47,"text":641},"md",null,{},true,{"title":124,"description":125},"hU_C5d4NLao6AoP_57FFNkPUN359IBWFz1EvuMAPImE",1790696775253]