Skip to content

Instantly share code, notes, and snippets.

@mikeobrien
Created December 6, 2010 03:44
Show Gist options
  • Save mikeobrien/729810 to your computer and use it in GitHub Desktop.
Save mikeobrien/729810 to your computer and use it in GitHub Desktop.
[CompilationMapping(SourceConstructFlags.Module)]
public static class Photon
{
public static double EnergyByFrequency(double nu, double multiplier)
{
return (h * (nu * multiplier));
}
[CompilationArgumentCounts(new int[] { 1, 1 })]
public static double EnergyByWavelength(double lambda, double multiplier)
{
return ((h * c) / (lambda * multiplier));
}
public static double c
{
[CompilerGenerated, DebuggerNonUserCode]
get
{
return 299792458.0;
}
}
public static double h
{
[CompilerGenerated, DebuggerNonUserCode]
get
{
return 6.62606896E-34;
}
}
// ...
}
[Serializable, CompilationMapping(SourceConstructFlags.ObjectType)]
public class Photon
{
public double EnergyByFrequency(double nu, double multiplier)
{
return (this.h * (nu * multiplier));
}
[CompilationArgumentCounts(new int[] { 1, 1 })]
public double EnergyByWavelength(double lambda, double multiplier)
{
return ((this.h * this.c) / (lambda * multiplier));
}
public double c
{
get
{
return 299792458.0;
}
}
public double h
{
get
{
return 6.62606896E-34;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment