DGtal  1.3.beta
Public Types | Public Member Functions
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

Definition at line 718 of file SegmentComputerEstimators.h.

◆ Value

Definition at line 719 of file SegmentComputerEstimators.h.

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  }

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:
DGtal::PointVector< 2, double >::L_2
@ L_2
Definition: PointVector.h:1493
DGtal::NumberTraitsImpl< std::decay< T >::type >::castToDouble
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
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165