File: Equation.h

package info (click to toggle)
rosegarden 1%3A1.4.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,188 kB
  • ctags: 15,707
  • sloc: cpp: 148,264; xml: 4,687; python: 1,946; makefile: 1,146; perl: 1,033; sh: 587; ansic: 337; ruby: 173
file content (25 lines) | stat: -rw-r--r-- 525 bytes parent folder | download | duplicates (2)
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
// -*- c-basic-offset: 4 -*-


#ifndef _EQUATION_H_
#define _EQUATION_H_

class Equation
{
public:
    enum Unknown { Y, M, X, C };

    struct Point {
	Point(int xx, int yy) : x(xx), y(yy) { }
	int x;
	int y;
    };

    static void solve(Unknown u, double &y, double &m, double &x, double &c);
    static void solve(Unknown u, int &y, double &m, int &x, int &c);

    static void solveForYByEndPoints(Point a, Point b, double x, double &y);
    static void solveForYByEndPoints(Point a, Point b, int x, int &y);
};

#endif