New Immissions/Updates:
boundless - educate - edutalab - empatico - es-ebooks - es16 - fr16 - fsfiles - hesperian - solidaria - wikipediaforschools
- wikipediaforschoolses - wikipediaforschoolsfr - wikipediaforschoolspt - worldmap -

See also: Liber Liber - Libro Parlato - Liber Musica  - Manuzio -  Liber Liber ISO Files - Alphabetical Order - Multivolume ZIP Complete Archive - PDF Files - OGG Music Files -

PROJECT GUTENBERG HTML: Volume I - Volume II - Volume III - Volume IV - Volume V - Volume VI - Volume VII - Volume VIII - Volume IX

Ascolta ""Volevo solo fare un audiolibro"" su Spreaker.
CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
User:Brhaspati/indflag - Wikipedia, the free encyclopedia

User:Brhaspati/indflag

From Wikipedia, the free encyclopedia

This is a temporary page to get a good representation of the Flag of India.

[edit] Sources

This implementation is based on a combination of FOTW description and the image on the GOI directory. The non-intuitive part of the code is in drawing the chakra, for which I used the FOTW figure as a guide.

[edit] Bugs

Current problems with the figure produced by this code:

  • Figure needs to be anti-aliased.
  • Chakra looks too blue in the center and too white in the edges. Looks a little like some sort of bacterium, especially at reduced sizes. This needs to be rectified.

[edit] Code

% indflag.m
% Written by [[User:Brhaspati]], 2005.
% Code should work in most versions of MATLAB.
% Released under GPL.
%
% MATLAB is a trademark of MathWorks Inc.
%

clear all; close all; clc;

% Define colors (cite source if possible)
saffron  = [251 119   0] ./ 255;    % GOI uses this. FOTW uses [255 204 0].
white    = [255 255 255] ./ 255;
green    = [ 19 136   8] ./ 255;    % GOI uses this. FOTW uses [51 153 51].
navyblue = [  0   0 128] ./ 255;

radius = 1;     % Any positive real number should do - everything else is scaled to this.
ratio = 0.75;   % ratio of diameter of Ashok chakra to the width of the white band.
% This is 75% of the width. Though is misused by flag makers.

npoints = 5000;         % Use more points for better circles and slower rendering.
twopi = pi + pi;        % self-explanatory
r = 5 * pi / 72;        % radius of the small circles around the rim of the Ashok chakra
rim = 5 * (1 + pi/72);  % radius of the rim
y = 6 * radius / ratio; % (1/6) of the height of the flag.
x = 4.5 * y;            % width of the flag, keeping the specified 3:2 width:height ratio.

figure; hold on; axis equal; axis ([-x x -3*y 3*y]); axis off;

% Top band, saffron.
X = [-x x x -x];    Y = [y y 3*y 3*y];
fill (X, Y, saffron, 'EdgeColor', saffron);
% Middle band, white.
X = [-x x x -x];    Y = [y y -y -y];
fill (X, Y, white, 'EdgeColor', white);   % middle band
% Bottom band, green.
X = [-x x x -x];    Y = [-y -y -3*y -3*y];
fill (X, Y, green, 'EdgeColor', green);   % bottom band

% Begin drawing the navy blue Ashok chakra.
% Using FOTW description for shape and ratio of the chakra.
% blue rim
[X,Y] = pol2cart (linspace (0, twopi, npoints), ones (1, npoints) * 6 * radius);
fill (X, Y, navyblue, 'EdgeColor', navyblue);
% white annulus. Spokes will go here later.
[X,Y] = pol2cart (linspace (0, twopi, npoints), ones (1, npoints) * rim * radius);
fill (X, Y, white, 'EdgeColor', navyblue);
% blue core
[X,Y] = pol2cart (linspace (0, twopi, npoints), ones (1, npoints) * radius);
fill (X, Y, navyblue, 'EdgeColor', navyblue);

% 24 spokes
for theta = 0:15:359
    % calculate some angles
    t = theta * pi / 180.0;
    t1 = (theta + 3.75) * pi / 180.0;       t2 = (theta - 3.75) * pi / 180.0;
    t11  = (theta + 7.5) * pi / 180.0;      t22  = (theta - 7.5) * pi / 180.0;

    % draw a spoke. The spoke is a very thin pentagon, with its base resting on the core and the apex on the inner edge of the rim.
    X = [radius*cos(t1) radius*cos(t1)+radius*cos(t11) rim*radius*cos(t) radius*cos(t2)+radius*cos(t22) radius*cos(t2)];
    Y = [radius*sin(t1) radius*sin(t1)+radius*sin(t11) rim*radius*sin(t) radius*sin(t2)+radius*sin(t22) radius*sin(t2)];
    fill (X, Y, navyblue, 'EdgeColor', navyblue);

    % draw the small blue circles around the inner edge of the rim.
    [X,Y] = pol2cart (linspace (0, twopi, npoints), ones (1, npoints) * r * radius);
    X = X + rim*radius*cos(t11);        Y = Y + rim*radius*sin(t11);
    fill (X, Y, navyblue, 'EdgeColor', navyblue);
end

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu