File: test-vector.c

package info (click to toggle)
giza 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,352 kB
  • sloc: ansic: 13,252; sh: 4,205; f90: 3,003; lex: 437; perl: 330; makefile: 99
file content (58 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download
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
/* giza - a scientific plotting library built on cairo
 *
 * Copyright (c) 2010      James Wetter and Daniel Price
 * Copyright (c) 2010-2012 Daniel Price
 *
 * This library is free software; and you are welcome to redistribute
 * it under the terms of the GNU General Public License
 * (GPL, see LICENSE file for details) and the provision that
 * this notice remains intact. If you modify this file, please
 * note section 5a) of the GPLv3 states that:
 *
 *  a) The work must carry prominent notices stating that you modified
 *  it, and giving a relevant date.
 *
 * This software is distributed "AS IS", with ABSOLUTELY NO WARRANTY.
 * See the GPL for specific language governing rights and limitations.
 *
 * The Original code is the giza plotting library.
 *
 * Contributor(s):
 *      James Wetter <wetter.j@gmail.com>
 *      Daniel Price <daniel.price@monash.edu> (main contact)
 */

#include <giza.h>

int
main ()
{
  giza_open_device ("?", "arrows");
  giza_start_warnings ();
  giza_set_window (0., 10., 0., 10.);
  giza_box ("BCNT", 0., 0, "BCTN", 0., 0);

  const int n = 2, m = 2;
  float hori[m][n], vert[m][n];
  float scale = 1.;
  float affine[6];

  hori[0][0] = .5;
  hori[0][1] = .5;
  hori[1][0] = .5;
  hori[1][1] = .5;
  vert[0][0] = .5;
  vert[0][1] = .5;
  vert[1][0] = .5;
  vert[1][1] = .5;
  affine[0] = 2.;
  affine[1] = 0.;
  affine[2] = 0.;
  affine[3] = 2.;
  affine[4] = 0.;
  affine[5] = 0.;

  giza_vector_float (n, m, (float *) &hori, (float *) &vert, 0, 1, 0, 1, scale, 0, affine, 1000.);

  giza_close_device ();
}