src/p/y/pycppad-HEAD/example/std_math.py pycppad(Download)
assert abs( cosh(a_x) - math.cosh(x) ) < delta assert abs( exp(a_x) - math.exp(x) ) < delta assert abs( log(a_x) - math.log(x) ) < delta assert abs( log10(a_x) - math.log10(x) ) < delta assert abs( sin(a_x) - math.sin(x) ) < delta assert abs( sinh(a_x) - math.sinh(x) ) < delta assert abs( sqrt(a_x) - math.sqrt(x) ) < delta
assert abs( cosh(a2x) - math.cosh(x) ) < delta assert abs( exp(a2x) - math.exp(x) ) < delta assert abs( log(a2x) - math.log(x) ) < delta assert abs( log10(a2x) - math.log10(x) ) < delta assert abs( sin(a2x) - math.sin(x) ) < delta assert abs( sinh(a2x) - math.sinh(x) ) < delta assert abs( sqrt(a2x) - math.sqrt(x) ) < delta
src/p/y/pygrace-HEAD/trunk/Examples/example_tools.py pygrace(Download)
def singleplot():
import math
dn = 10
x = [10**(i/float(dn)) for i in range(-3*dn, 3*dn + 1)]
y1 = [10**math.cos(math.log10(i)**2) for i in x]
y2 = [10**math.sin(math.log10(i)**2) for i in x]
data1 = zip(x, y1)
src/p/y/pygrace-HEAD/Examples/example_tools.py pygrace(Download)
def singleplot():
import math
dn = 10
x = [10**(i/float(dn)) for i in range(-3*dn, 3*dn + 1)]
y1 = [10**math.cos(math.log10(i)**2) for i in x]
y2 = [10**math.sin(math.log10(i)**2) for i in x]
data1 = zip(x, y1)
src/v/t/VT-USRP-daughterboard-drivers_python-HEAD/gnuradio-examples/python/usrp/usrp_spectrum_sense.py VT-USRP-daughterboard-drivers_python(Download)
# FIXME the log10 primitive is dog slow
log = gr.nlog10_ff(10, self.fft_size,
-20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size))
# Set the freq_step to 75% of the actual data throughput.
# This allows us to discard the bins on both ends of the spectrum.
src/q/u/quickflash-HEAD/branch_tags/octave-swig/QuickFlash-1.0.0-Octave-1.0/examples/boxcount/plot_boxcounts.py quickflash(Download)
for point_index in range(num_points) :
log10_width = math.log10(widths[point_index])
log_widths.append(log10_width)
log_oneOver_widths.append(-1.0 * log10_width)
log_counts.append(math.log10(counts[point_index]))
for point_index in range(num_points) :
log10_width = math.log10(widths[point_index])
log_widths.append(log10_width)
log_oneOver_widths.append(-1.0 * log10_width)
log_counts.append(math.log10(counts[point_index]))
src/p/l/plplot-HEAD/trunk/examples/python/x04.py plplot(Download)
## ampl.append( ## 20.0 * math.log10(1.0 / math.sqrt(1.0 + pow((freq / f0), 2.))) ## ) ampl[i] = 20.0 * math.log10(1.0 / math.sqrt(1.0 + pow((freq / f0), 2.))) ## phase.append(-(180.0 / math.pi) * math.atan(freq / f0)) phase[i] = -(180.0 / math.pi) * math.atan(freq / f0)
src/p/l/plplot-HEAD/examples/python/x04.py plplot(Download)
## ampl.append( ## 20.0 * math.log10(1.0 / math.sqrt(1.0 + pow((freq / f0), 2.))) ## ) ampl[i] = 20.0 * math.log10(1.0 / math.sqrt(1.0 + pow((freq / f0), 2.))) ## phase.append(-(180.0 / math.pi) * math.atan(freq / f0)) phase[i] = -(180.0 / math.pi) * math.atan(freq / f0)
src/q/u/quickflash-HEAD/branch_tags/octave-swig/QuickFlash-1.0.0-Octave-1.0/examples/slicer/generate_slice_svg.py quickflash(Download)
colormap_width = colormap_info.get_width_pixels() ## Not necessarily x
if (colormap_log_scale) :
colormap_min_value = math.log10(colormap_min_value)
colormap_max_value = math.log10(colormap_max_value)
src/s/h/shedskin-HEAD/examples/ml/minilight.py shedskin(Download)
from image import Image from scene import Scene from math import log10 from sys import argv, stdout from time import time
if SAVE_PERIOD < time() - last_time or frame_no == iterations:
last_time = time()
save_image(image_file_pathname, image, frame_no)
stdout.write('\b' * ((int(log10(frame_no - 1)) if frame_no > 1 else -1) + 12) + 'iteration: %u' % frame_no)
stdout.flush()
print '\nfinished'
except KeyboardInterrupt:
src/s/h/shedskin-HEAD/examples/ml/image.py shedskin(Download)
# MiniLight Python : minimal global illumination renderer # # Copyright (c) 2007-2008, Harrison Ainsworth / HXA7241 and Juraj Sukop. # http://www.hxa7241.org/ from math import log10
def calculate_tone_mapping(self, pixels, divider):
sum_of_logs = 0.0
for i in range(len(pixels) / 3):
y = Vector3f_seq(pixels[i * 3: i * 3 + 3]).dot(RGB_LUMINANCE) * divider
sum_of_logs += log10(y if y > 1e-4 else 1e-4)
log_mean_luminance = 10.0 ** (sum_of_logs / (len(pixels) / 3))
a = 1.219 + (DISPLAY_LUMINANCE_MAX * 0.25) ** 0.4
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next