Git Product home page Git Product logo

shbox's Introduction

================================================================
SHBox --- A matlab toolbox for spherical harmonics.
================================================================

Author: Ying Xiong.
Created: Jul 21, 2013.
Release: Jan 17, 2014 (v0.1).

================================================================
Quick start.
================================================================
>> addpath('Utils');
>> SHBoxTest;
>> demoSHBox;

================================================================
Definitions.
================================================================

The inner product in spherical space is defined as
           / \pi        / \pi
  <f, g> = |            |            f(\theta,\phi) g*(\theta,\phi) d\Omega,
           / \theta=0   / \phi=-pi
where
  d\Omega = sin(\theta) d\phi d\theta.

The spherical harmonic functions are defined as
                             (2l+1) (l-m)!
  Y_l^m(\theta,\phi) = sqrt{---------------} P_l^m(cos(\theta)) exp(im\phi)
                              4 pi  (l+m)!
                     = (-1)^m sqrt{1/(2 pi)} N_l^m(cos(\theta)) exp(im\phi),
where P_l^m is associated Legendre function, and N_l^m is fully normalized
associated Legendre function. Therefore, we have
  < Y_{l1}^{m1}, Y_{l2}^{m2} > = \delta_{l1,l2} \delta_{m1,m2}.

The real spherical harmonic functions are defined as
             / 1/sqrt(2) (Y_l^{-m} + (-1)^m Y_l^m)   if m>0
  Y_{l,m} = |  Y_l^0                                 if m=0
             \ 1/sqrt(2) (Y_l^m - (-1)^m Y_l^{-m})   if m<0.

================================================================
Representations.
================================================================
A spherical function f(\theta, \phi) is represented by a matrix 'F' with two
(optional) coordinate lists 'lTheta' and 'lPhi', such that
  F(i,j) = f(lTheta(i), lPhi(j)).
If not specified, 'lTheta' and 'lPhi' are by default
  lTheta = linspace(0, pi, size(F,1)),
  lPhi = linspace(-pi, pi, size(F,2)).
If 'lTheta' and 'lPhi' are scalars, they will be converted to
  lTheta = linspace(0, pi, lTheta),
  lPhi = linspace(-pi, pi, lPhi).

================================================================
Features.
================================================================
* Generate real and complex spherical harmonic functions.
* Visualize spherical functions.
* Inner product in spherical space.
* Decompose spherical function into spherical harmonic components.

See 'SphericalHarmonics.pdf' for a more detailed documentation.

================================================================
Other notes.
================================================================
The 'pisa.png' file is a light probe image downloaded from http://gl.ict.usc.edu/Data/HighResProbes/ and modified (tone-mapped and resized) by Ying Xiong.

shbox's People

Contributors

yxiong avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.