Changeset 7735:5af6ad7bad8c
- Timestamp:
- 12/01/07 18:15:02 (5 years ago)
- Branch:
- default
- Tags:
- 2.9.rc0
- File:
-
- 1 edited
-
sage/matrix/matrix2.pyx (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/matrix/matrix2.pyx
r7723 r7735 2845 2845 the same pixelsize as the matrix dimensions (default: 512) 2846 2846 2847 EXAMPLE: 2848 sage: M = random_matrix(CC, 4) 2849 sage: M.visualize_structure() 2850 2847 2851 """ 2848 2852 import gd 2849 2853 import os 2850 2854 2851 cdef int x, y, _x, _y, v, bi 2855 cdef int x, y, _x, _y, v, bi, bisq 2852 2856 cdef int ir,ic 2853 2857 cdef float b, fct … … 2876 2880 fct = 255.0/(b*b) 2877 2881 bi = <int>b 2882 bisq = bi*bi 2878 2883 2879 2884 im = gd.image((ir,ic),1) … … 2887 2892 for x from 0 <= x < ic: 2888 2893 for y from 0 <= y < ir: 2894 v = bisq 2889 2895 for _x from 0 <= _x < bi: 2890 2896 for _y from 0 <= _y < bi: … … 2892 2898 v-=1 #increase darkness 2893 2899 2894 v = int( b*b*fct)2900 v = int(v*v*fct) 2895 2901 val = colorExact((v,v,v)) 2896 2902 setPixel((y,x), val)
Note: See TracChangeset
for help on using the changeset viewer.
