~ubuntu-branches/ubuntu/breezy/garlic/breezy

« back to all changes in this revision

Viewing changes to scalar_product.c

  • Committer: Bazaar Package Importer
  • Author(s): zhaoway
  • Date: 2001-04-24 07:09:13 UTC
  • Revision ID: james.westby@ubuntu.com-20010424070913-uzpupnwdfhmliebz
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2000 Damir Zucic */
 
2
 
 
3
/*=============================================================================
 
4
 
 
5
                                scalar_product.c
 
6
 
 
7
Purpose:
 
8
        Calculate the scalar product of two vectors.
 
9
 
 
10
Input:
 
11
        (1) Pointer to VectorS structure, with the first vector.
 
12
        (2) Pointer to VectorS structure, with the second vector.
 
13
 
 
14
Output:
 
15
        Return value.
 
16
 
 
17
Return value:
 
18
        Scalar product of two vectors (double value).
 
19
 
 
20
========includes:============================================================*/
 
21
 
 
22
#include <stdio.h>
 
23
 
 
24
#include <X11/Xlib.h>
 
25
#include <X11/Xutil.h>
 
26
#include <X11/Xos.h>
 
27
#include <X11/Xatom.h>
 
28
 
 
29
#include "defines.h"
 
30
#include "typedefs.h"
 
31
 
 
32
/*======calculate scalar product of two vectors:=============================*/
 
33
 
 
34
double ScalarProduct_ (VectorS *vector1SP, VectorS *vector2SP)
 
35
{
 
36
 
 
37
return (vector1SP->x * vector2SP->x +
 
38
        vector1SP->y * vector2SP->y +
 
39
        vector1SP->z * vector2SP->z);
 
40
 
 
41
}
 
42
 
 
43
/*===========================================================================*/
 
44
 
 
45