This file is indexed.

/usr/share/doc/libplplot12/examples/ada/x18a.adb is in libplplot-ada1-dev 5.10.0+dfsg2-0.1ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
-- $Id: x18a.adb 11680 2011-03-27 17:57:51Z airwin $

--  3-d line and point plot demo.  Adapted from x08c.c.

-- Copyright (C) 2008 - 2011 Jerry Bauck

-- This file is part of PLplot.

-- PLplot is free software; you can redistribute it and/or modify
-- it under the terms of the GNU Library General Public License as published
-- by the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.

-- PLplot is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU Library General Public License for more details.

-- You should have received a copy of the GNU Library General Public License
-- along with PLplot; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

with
    Ada.Numerics,
    System,
    Ada.Numerics.Long_Elementary_Functions,
    Ada.Strings,
    Ada.Strings.Fixed,
    PLplot_Auxiliary,
    PLplot_Traditional;
use
    Ada.Numerics,
    Ada.Numerics.Long_Elementary_Functions,
    Ada.Strings,
    Ada.Strings.Fixed,
    PLplot_Auxiliary,
    PLplot_Traditional;

procedure x18a is
    ----------------------------------------------------------------------------
    -- Does a series of 3-d plots for a given data set, with different
    -- viewing options in each plot.
    ----------------------------------------------------------------------------

    opt : array(0 .. 3) of Boolean := (True, False, True, False);
    alt : Real_Vector(0 .. 3) := (20.0, 35.0, 50.0, 65.0);
    az  : Real_Vector(0 .. 3) := (30.0, 40.0, 50.0, 60.0);
    NPTS : constant Integer := 1000;
    x, y, z : Real_Vector(0 .. NPTS - 1);
    r : Long_Float;


    procedure test_poly(k : Integer) is
        x, y, z : Real_Vector(0 .. 4);
        Two_Pi : Long_Float := 2.0 * pi;
        draw : array(0 .. 3) of Boolean_Array_1D(0 .. 3);
        
        function THETA(a : Integer) return Long_Float is
        begin
            return Two_Pi * Long_Float(a) / 20.0;
        end;
        
        function PHI(a : Integer) return Long_Float is
        begin
            return pi * Long_Float(a) / 20.1;
        end;
        
    begin
        draw(0) := (True,  True,  True,  True);
        draw(1) := (True,  False, True,  False);
        draw(2) := (False, True,  False, True);
        draw(3) := (True,  True,  False, False);
        
        pladv(0);
        plvpor(0.0, 1.0, 0.0, 0.9);
        plwind(-1.0, 1.0, -0.9, 1.1);
        plcol0(1);
        plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt(k), az(k));
        plbox3("bnstu", "x axis", 0.0, 0,
           "bnstu", "y axis", 0.0, 0,
           "bcdmnstuv", "z axis", 0.0, 0);
        plcol0(2);

        for i in 0 .. 19 loop
            for j in 0 .. 19 loop
                x(0) := sin(PHI(j)) * cos(THETA(i));
                y(0) := sin(PHI(j)) * sin(THETA(i));
                z(0) := cos(PHI(j));
                
                x(1) := sin(PHI(j + 1)) * cos(THETA(i));
                y(1) := sin(PHI(j + 1)) * sin(THETA(i));
                z(1) := cos(PHI(j + 1));
                
                x(2) := sin(PHI(j + 1)) * cos(THETA(i + 1));
                y(2) := sin(PHI(j + 1)) * sin(THETA(i + 1));
                z(2) := cos(PHI(j + 1));
                
                x(3) := sin(PHI(j)) * cos(THETA(i + 1));
                y(3) := sin(PHI(j)) * sin(THETA(i + 1));
                z(3) := cos(PHI(j));
                
                x(4) := sin(PHI(j)) * cos(THETA(i));
                y(4) := sin(PHI(j)) * sin(THETA(i));
                z(4) := cos(PHI(j));

                plpoly3(x, y, z, draw(k), True );
            end loop;
        end loop;

        plcol0(3);
        plmtex("t", 1.0, 0.5, 0.5, "unit radius sphere" );
    end test_poly;

begin
    -- Parse and process command line arguments 
    plparseopts(PL_PARSE_FULL);

    -- Initialize plplot 
    plinit;

    for k in 0 .. 3 loop
        test_poly(k);
    end loop;

    -- From the mind of a sick and twisted physicist... 
    for i in x'range loop
        z(i) := -1.0 + 2.0 * Long_Float(i) / Long_Float(NPTS);

        -- Pick one... 
        r := z(i);

        x(i) := r * cos( 2.0 * pi * 6.0 * Long_Float(i) / Long_Float(NPTS) );
        y(i) := r * sin( 2.0 * pi * 6.0 * Long_Float(i) / Long_Float(NPTS) );
    end loop;

    for k in opt'range loop
        pladv(0);
        plvpor(0.0, 1.0, 0.0, 0.9);
        plwind(-1.0, 1.0, -0.9, 1.1);
        plcol0(1);
        plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt(k), az(k));
        plbox3("bnstu", "x axis", 0.0, 0,
               "bnstu", "y axis", 0.0, 0,
               "bcdmnstuv", "z axis", 0.0, 0);
        plcol0(2);

        if opt(k) then
            plline3(x, y, z);
        else
            -- U+22C5 DOT OPERATOR.
            plstring3(x, y, z, "⋅");
        end if;

        plcol0(3);
        plmtex("t", 1.0, 0.5, 0.5, "#frPLplot Example 18 - Alt=" & 
            Trim(Integer'image(Integer(alt(k))), Left) & ", Az=" & 
            Trim(Integer'image(Integer( az(k))), Left));
    end loop;

    plend;
end x18a;