// Generated by gmmproc 2.89.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gdkmm/graphene_vec2.h>
#include <gdkmm/private/graphene_vec2_p.h>


/* Copyright 2026 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gdkmm/graphene_point.h>

namespace Gdk
{
namespace Graphene
{

Vec2::Vec2()
:
  gobject_(*graphene_vec2_zero())
{}

Vec2::Vec2(float x, float y)
{
  (void)graphene_vec2_init(gobj(), x, y);
}

Vec2::Vec2(const Point& src)
{
  graphene_point_to_vec2(src.gobj(), gobj());
}

Vec2::Vec2(const graphene_vec2_t* vec2)
:
  gobject_(vec2 ? *vec2 : *graphene_vec2_zero())
{}

std::array<float,2> Vec2::to_float() const
{
  std::array<float,2> result;
  graphene_vec2_to_float(gobj(), result.data());
  return result;
}

Vec2 Vec2::add(const Vec2& other) const
{
  Vec2 result;
  graphene_vec2_add(gobj(), other.gobj(), result.gobj());
  return result;
}

Vec2 Vec2::subtract(const Vec2& other) const
{
  Vec2 result;
  graphene_vec2_subtract(gobj(), other.gobj(), result.gobj());
  return result;
}

Vec2 Vec2::normalize() const
{
  Vec2 result;
  graphene_vec2_normalize(gobj(), result.gobj());
  return result;
}

Vec2 Vec2::scale(float factor) const
{
  Vec2 result;
  graphene_vec2_scale(gobj(), factor, result.gobj());
  return result;
}

Vec2 Vec2::negate() const
{
  Vec2 result;
  graphene_vec2_negate(gobj(), result.gobj());
  return result;
}

Vec2 Vec2::interpolate(const Vec2& other, double factor) const
{
  Vec2 result;
  graphene_vec2_interpolate(gobj(), other.gobj(), factor, result.gobj());
  return result;
}

} // namespace Graphene
} // namespace Gdk

namespace
{
} // anonymous namespace


namespace Gdk
{

namespace Graphene
{


float Vec2::dot(const Vec2& other) const
{
  return graphene_vec2_dot(const_cast<graphene_vec2_t*>(gobj()), (other).gobj());
}

float Vec2::length() const
{
  return graphene_vec2_length(const_cast<graphene_vec2_t*>(gobj()));
}

bool Vec2::near(const Vec2& other, float epsilon) const
{
  return graphene_vec2_near(const_cast<graphene_vec2_t*>(gobj()), (other).gobj(), epsilon);
}

bool Vec2::equal(const Vec2& other) const
{
  return graphene_vec2_equal(const_cast<graphene_vec2_t*>(gobj()), (other).gobj());
}

float Vec2::get_x() const
{
  return graphene_vec2_get_x(const_cast<graphene_vec2_t*>(gobj()));
}

float Vec2::get_y() const
{
  return graphene_vec2_get_y(const_cast<graphene_vec2_t*>(gobj()));
}


} // namespace Graphene

} // namespace Gdk


