Sha256: 3a7fbebb8f2496a5bf30fe29ff9625b107d437777009b880ab3a5a1cff815918

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

package org.sunflow.image;

public class BlackbodySpectrum extends SpectralCurve {

    private final float temp;

    public BlackbodySpectrum(float temp) {
        this.temp = temp;
    }

    @Override
    public float sample(float lambda) {
        double wavelength = lambda * 1e-9;
        return (float) ((3.74183e-16 * Math.pow(wavelength, -5.0)) / (Math.exp(1.4388e-2 / (wavelength * temp)) - 1.0));
    }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
joonsrenderer-1.3.1-java src/main/java/org/sunflow/image/BlackbodySpectrum.java
joonsrenderer-1.2.0-java src/main/java/org/sunflow/image/BlackbodySpectrum.java
joonsrenderer-1.1.3-java src/main/java/org/sunflow/image/BlackbodySpectrum.java
joonsrenderer-1.1.2-java src/main/java/org/sunflow/image/BlackbodySpectrum.java
joonsrenderer-1.1.1-java src/main/java/org/sunflow/image/BlackbodySpectrum.java
joonsrenderer-1.1-java src/main/java/org/sunflow/image/BlackbodySpectrum.java