DGtal  1.5.beta
DGtal::detail::NormalizedTangentVectorFromDSS Struct Reference

#include <DGtal/geometry/curves/estimation/SegmentComputerEstimators.h>

Public Types

typedef DGtal::PointVector< 2, double > RealVector
 
typedef RealVector Value
 

Public Member Functions

template<typename DSS >
Value operator() (const DSS &aDSS) const
 

Detailed Description

Description of class 'NormalizedTangentVectorFromDSS'

Aim: computes the unit vector of a DSS

Definition at line 715 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ RealVector

◆ Value

Member Function Documentation

◆ operator()()

template<typename DSS >
Value DGtal::detail::NormalizedTangentVectorFromDSS::operator() ( const DSS &  aDSS) const
inline

Operator()

Returns
normalized tangent
Parameters
aDSSan instance of segment computer devoted to the DSS recognition.
Template Parameters
DSSa model of segment computer, which must have methods a() and b() returning the y- and x-component of the tangent vector.

Definition at line 734 of file SegmentComputerEstimators.h.

735  {
737  ::castToDouble( aDSS.b() );
739  ::castToDouble( aDSS.a() );
740  RealVector v(x,y);
741  double norm = v.norm(RealVector::L_2);
742  v /= norm;
743  return v;
744  }
static double castToDouble(const std::decay< T >::type &aT)
Cast method to double (for I/O or board export uses only).
Definition: NumberTraits.h:164

References DGtal::NumberTraitsImpl< std::decay< T >::type >::castToDouble(), and DGtal::PointVector< 2, double >::L_2.


The documentation for this struct was generated from the following file: