01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould/**
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * \file
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński * \brief Finding roots of Bernstein-Bezier polynomials
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński *//*
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * Authors:
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * ? <?@?.?>
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * Copyright ?-? authors
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * This library is free software; you can redistribute it and/or
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * modify it either under the terms of the GNU Lesser General Public
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * License version 2.1 as published by the Free Software Foundation
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * (the "LGPL") or, at your option, under the terms of the Mozilla
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * Public License Version 1.1 (the "MPL"). If you do not alter this
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * notice, a recipient may use your version of this file under either
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * the MPL or the LGPL.
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * You should have received a copy of the LGPL along with this library
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * in the file COPYING-LGPL-2.1; if not, write to the Free Software
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * You should have received a copy of the MPL along with this library
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * in the file COPYING-MPL-1.1
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * The contents of this file are subject to the Mozilla Public License
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * Version 1.1 (the "License"); you may not use this file except in
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * compliance with the License. You may obtain a copy of the License at
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * http://www.mozilla.org/MPL/
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * OF ANY KIND, either express or implied. See the LGPL or the MPL for
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould * the specific language governing rights and limitations.
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould *
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould */
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould
76addc201c409e81eaaa73fe27cc0f79c4db097cKrzysztof Kosiński#ifndef LIB2GEOM_SEEN_SOLVER_H
76addc201c409e81eaaa73fe27cc0f79c4db097cKrzysztof Kosiński#define LIB2GEOM_SEEN_SOLVER_H
76addc201c409e81eaaa73fe27cc0f79c4db097cKrzysztof Kosiński
8001ba81cb851b38d86650a2fef5817facffb763johanengelen#include <2geom/point.h>
8001ba81cb851b38d86650a2fef5817facffb763johanengelen#include <2geom/sbasis.h>
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen#include <vector>
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
76addc201c409e81eaaa73fe27cc0f79c4db097cKrzysztof Kosińskinamespace Geom {
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
29684a16b6c92bee28a94fdc2607bcc143950fa8johanengelen class Point;
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen class Bezier;
29684a16b6c92bee28a94fdc2607bcc143950fa8johanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenunsigned
981b809bc6ed10a21e89444d9447e5475801874fjohanengelencrossing_count(Geom::Point const *V, /* Control pts of Bezier curve */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned degree); /* Degree of Bezier curve */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenvoid
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenfind_parametric_bezier_roots(
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen Geom::Point const *w, /* The control points */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned degree, /* The degree of the polynomial */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen std::vector<double> & solutions, /* RETURN candidate t-values */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned depth); /* The depth of the recursion */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenunsigned
981b809bc6ed10a21e89444d9447e5475801874fjohanengelencrossing_count(double const *V, /* Control pts of Bezier curve */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned degree, /* Degree of Bezier curve */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen double left_t, double right_t);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenvoid
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenfind_bernstein_roots(
29684a16b6c92bee28a94fdc2607bcc143950fa8johanengelen double const *w, /* The control points */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned degree, /* The degree of the polynomial */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen std::vector<double> & solutions, /* RETURN candidate t-values */
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen unsigned depth, /* The depth of the recursion */
6bc0b25077dcb0cce5dea357de5bab735babe891johanengelen double left_t=0, double right_t=1, bool use_secant=true);
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen};
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenvoid
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenfind_bernstein_roots(std::vector<double> &solutions, /* RETURN candidate t-values */
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen Geom::Bezier const& bz,
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen double left_t, double right_t);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen#endif
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen/*
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen Local Variables:
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen mode:c++
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen c-file-style:"stroustrup"
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen indent-tabs-mode:nil
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen fill-column:99
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen End:
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen*/
a4030d5ca449e7e384bc699cd249ee704faaeab0Chris Morgan// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :