-
Notifications
You must be signed in to change notification settings - Fork 0
Vector Extension
CrocBlanc edited this page Sep 1, 2025
·
2 revisions
see import
dofile("vector.methods.lua")
OR
import("https://raw.githubusercontent.com/CrocBlancYT/computer-craft-libraries/refs/heads/main/src/vector.methods.lua")local v, vector.new(1,0,0)
local pi = v:angle(-v)local v = vector.new(1,0,0)
local line = vector.new(2,0,0)
local scalar = v:component(line)local v = vector.new(1,0,0)
local line = vector.new(2,0,0)
local projection = v:projectOnto(line)local v = vector.new(1,1,1)
local normal = vector.new(0,1,0)
local flat = v:planeFromNormal(normal)local v = vector.new(1,0,0)
local axis = vector.new(0,1,0)
local theta = math.rad(90)
local flat = v:rotate(axis, theta)