Last active
January 31, 2017 13:26
-
-
Save kusma/2364735904f277aeac19 to your computer and use it in GitHub Desktop.
ATAN lut generator
This file contains 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
% ATAN lut-generator for Mesa3D | |
% Based on polyfitc, http://www.mathworks.com/matlabcentral/fileexchange/47851-constraint-polynomial-fit | |
X = linspace(0, 1); | |
Y = atan(X)'; | |
N = [1, 3, 5, 7, 9, 11]; | |
lsqM = ones(numel(X), numel(N)); | |
for n = 1:numel(N) | |
lsqM(:, n) = X.^N(n); | |
end | |
P = lsqM \ Y; | |
format long; | |
disp(P); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment