MOAB: Mesh Oriented datABase  (version 5.4.1)
v_vector.h File Reference
#include "moab/verdict.h"
#include <cmath>
#include <cassert>
+ Include dependency graph for v_vector.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double dot_product (double vec1[], double vec2[])
void normalize (double vec[])
double * cross_product (double vec1[], double vec2[], double answer[])
double length (double vec[])
double length_squared (double vec[])
double interior_angle (double vec1[], double vec2[])

Function Documentation

double* cross_product ( double  vec1[],
double  vec2[],
double  answer[] 
) [inline]

Definition at line 37 of file v_vector.h.

{
    answer[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
    answer[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
    answer[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
    return answer;
}
double dot_product ( double  vec1[],
double  vec2[] 
) [inline]

Definition at line 20 of file v_vector.h.

Referenced by interior_angle(), v_quad_distortion(), and v_tri_distortion().

{
    double answer = vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2];
    return answer;
}
double interior_angle ( double  vec1[],
double  vec2[] 
) [inline]

Definition at line 58 of file v_vector.h.

References dot_product(), length(), and VERDICT_PI.

Referenced by v_tri_quality().

{
    double cosAngle, angleRad;
    double length1 = length( vec1 );
    double length2 = length( vec2 );
    assert( ( length1 > 0.0 && length2 > 0.0 ) );

    cosAngle = dot_product( vec1, vec2 ) / ( length1 * length2 );

    if( ( cosAngle > 1.0 ) && ( cosAngle < 1.0001 ) )
    {
        cosAngle = 1.0;
    }
    else if( cosAngle < -1.0 && cosAngle > -1.0001 )
    {
        cosAngle = -1.0;
    }
    else
    {
        assert( cosAngle < 1.0001 && cosAngle > -1.0001 );
    }

    angleRad = acos( cosAngle );
    return ( ( angleRad * 180. ) / VERDICT_PI );
}
double length ( double  vec[]) [inline]
Examples:
LaplacianSmoother.cpp, and LloydRelaxation.cpp.

Definition at line 46 of file v_vector.h.

Referenced by moab::area_coordinates(), ZoltanPartitioner::balance_mesh(), moab::BVHTree::Bucket::bucket_index(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::bucket_index(), check_list_meshset_internal(), check_meshset_internal(), check_ranged_meshset_internal(), moab::GeomQueryTool::closest_to_location(), compute_area(), moab::copy_set_contents(), moab::ReadCGM::create_curve_facets(), moab::SysUtil::filesize(), smoab::detail::ReadSparseTag::fill(), moab::NestedRefine::find_shortest_diagonal_octahedron(), moab::Intx2MeshOnSphere::findNodes(), moab::SmoothFace::init_facet_control_points(), moab::WriteNCDF::initialize_exodus_file(), interior_angle(), is_acis_txt_file(), moab::SmoothFace::is_at_vertex(), moab::ReadMCNP5::load_file(), main(), ZoltanPartitioner::mbInitializePoints(), measure(), mhdf_compact_to_ranges(), mhdf_getElemHandles(), mhdf_name_to_path(), MetisPartitioner::partition_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), perform_laplacian_smoothing(), perform_lloyd_relaxation(), moab::LloydSmoother::perform_smooth(), points_are_coincident(), moab::TreeNodePrinter::print_geometry(), moab::SmoothFace::project_to_facets(), moab::SmoothFace::project_to_patch(), moab::AffineXform::rotation(), test_2D(), test_3D(), test_bound_box(), test_eval(), moab::SmoothCurve::u_from_position(), v_quad_distortion(), v_quad_maximum_angle(), v_quad_minimum_angle(), v_quad_scaled_jacobian(), v_tet_aspect_beta(), v_tet_quality(), v_tet_radius_ratio(), v_tri_quality(), v_tri_scaled_jacobian(), and TreeValidator::visit().

{
    return sqrt( vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2] );
}
void normalize ( double  vec[]) [inline]

Definition at line 27 of file v_vector.h.

Referenced by v_quad_quality(), v_quad_skew(), and v_quad_warpage().

{
    double x = sqrt( vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2] );

    vec[0] /= x;
    vec[1] /= x;
    vec[2] /= x;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines