This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void computeGradients(const Vector3& pa, const Vector3& pb, const Vector3& pc, const Vector3& pd, | |
Vector3& grad_pa, Vector3& grad_pb, Vector3& grad_pc, Vector3& grad_pd) { | |
// Step 1: Compute edge vectors using operator- | |
Vector3 eca = pc - pa; | |
Vector3 eda = pd - pa; | |
Vector3 edb = pd - pb; | |
Vector3 ecb = pc - pb; | |
Vector3 pd_pc = pd - pc; | |
double L = pd_pc.Norm(); | |
Vector3 ecd = (L < 1e-8) ? Vector3(0.0, 0.0, 0.0) : (pd_pc * (1.0 / L)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
#include "Vector3.h" // Assumes Vector3 class with standard operations | |
// Function to compute gradients of kappa with respect to pa, pb, pc, pd | |
void computeGradients(const Vector3& pa, const Vector3& pb, const Vector3& pc, const Vector3& pd, | |
Vector3& grad_pa, Vector3& grad_pb, Vector3& grad_pc, Vector3& grad_pd) { | |
// Step 1: Compute edge vectors | |
Vector3 eca = pc - pa; // pc - pa | |
Vector3 eda = pd - pa; // pd - pa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Geometric Algebra G(3) Library in Julia | |
# Types | |
struct G3Empty end | |
struct G3Vector{T<:Number} | |
e1::T | |
e2::T | |
e3::T | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// Assume Vector3 is a simple 3D vector class with basic operations | |
struct Vector3 { | |
float x, y, z; | |
Vector3(float x_ = 0, float y_ = 0, float z_ = 0) : x(x_), y(y_), z(z_) {} | |
Vector3 operator+(const Vector3& v) const { return Vector3(x + v.x, y + v.y, z + v.z); } | |
Vector3 operator-(const Vector3& v) const { return Vector3(x - v.x, y - v.y, z - v.z); } | |
Vector3 operator*(float s) const { return Vector3(x * s, y * s, z * s); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: | |
// ga_versor q = normalize(add(1.0, (ga_bivector){ .e12 = 1.0 })); | |
// see tests at end of file for more | |
#pragma once | |
#include <stdarg.h> | |
#include <complex.h> | |
#include <math.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TypedPools | |
export | |
Handle, | |
TypedPool, | |
StructPool, | |
MutableStructPool, | |
alloc!, | |
alloc_args!, | |
alloc_inplace!, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
set ignorecase | |
set smartcase | |
set hlsearch | |
set wildmenu | |
set showcmd | |
set nocompatible | |
syntax on | |
filetype plugin indent on | |
set shiftwidth=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Develop your clojurescript program here | |
(ns metacirc.evaluator (:require [cljs.reader :as reader])) | |
;; TODO: | |
;; globals: "let", "do" | |
;; javascript interop | |
;; var args or at least get more than 4 for list | |
;; {} [] #{} '() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; TODO: deletion. warning when adding group to existing name. is this implemenation of groups a good thing? | |
(ns forces.framework.component | |
) | |
(def !nextEntityGUID (atom 1)) | |
(def !names (atom {})) | |
(def !nameReverseLookup (atom {})) ;; name to guid map | |
NewerOlder