Skip to content

Instantly share code, notes, and snippets.

@N-Carter
N-Carter / SplineMeshEditor.cs
Created May 14, 2012 23:22
Custom inspector for SplineMesh
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Linq;
[CustomEditor(typeof(SplineMesh))]
public class SplineMeshEditor : Editor
{
protected SplineMesh m_Target;
protected MeshFilter m_MeshFilter;
@maccesch
maccesch / lagrange.js
Created May 27, 2011 12:27
Lagrange Polynomial Interpolation. Example: http://jsfiddle.net/maccesch/jgU3Y/
/**
* At least two points are needed to interpolate something.
* @class Lagrange polynomial interpolation.
* The computed interpolation polynomial will be reffered to as L(x).
* @example
* var l = new Lagrange(0, 0, 1, 1);
* var index = l.addPoint(0.5, 0.8);
* console.log(l.valueOf(0.1));
*
* l.changePoint(index, 0.5, 0.1);