当前位置: 首页>>代码示例>>Java>>正文


Java Vector3D.getNorm方法代码示例

本文整理汇总了Java中org.apache.commons.math3.geometry.euclidean.threed.Vector3D.getNorm方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3D.getNorm方法的具体用法?Java Vector3D.getNorm怎么用?Java Vector3D.getNorm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.geometry.euclidean.threed.Vector3D的用法示例。


在下文中一共展示了Vector3D.getNorm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; //导入方法依赖的package包/类
@Override
public void update() {

	Vector3D normal_unnormalized = (verts[1].pos.subtract(verts[0].pos)).crossProduct(verts[2].pos.subtract(verts[0].pos));

	if (normal_unnormalized.getNorm() > 0) {
		this.faceNormal = normal_unnormalized.normalize();
	}
}
 
开发者ID:GIScience,项目名称:helios,代码行数:10,代码来源:Triangle.java

示例2: getVisiblePoints

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; //导入方法依赖的package包/类
HashSet<VisiblePoint> getVisiblePoints(Vector3D rayOrigin) {

		HashSet<VisiblePoint> result = new HashSet<>();

		for (Vector3D testPoint : vtps) {

			Vector3D rayDir = testPoint.subtract(rayOrigin);

			if (rayDir.getNorm() == 0) {
				continue;
			}

			rayDir = rayDir.normalize();

			// Otherwise, check for intersection with a primitive using the kdtree:
			RaySceneIntersection intersect = scene.getIntersection(rayOrigin, rayDir, false);

			// TODO 4: Try to get true incidence angle
			double incidenceAngle = (Math.PI / 4);

			double intersectDistance = Double.MAX_VALUE;

			if (intersect != null) {
				intersectDistance = rayOrigin.distance(intersect.point);
				incidenceAngle = intersect.prim.getIncidenceAngle_rad(rayOrigin, rayDir);
			}

			double testpointRayDistance = Vector3D.crossProduct(rayDir, testPoint.subtract(rayOrigin)).getNorm();

			if (testpointRayDistance < cfg_hitTolerance_m && rayOrigin.distance(testPoint) <= intersectDistance + cfg_hitTolerance_m) {

				VisiblePoint rsc = new VisiblePoint();
				rsc.angle = incidenceAngle;
				rsc.pos = testPoint;

				result.add(rsc);
			}
		}

		return result;
	}
 
开发者ID:GIScience,项目名称:helios,代码行数:42,代码来源:AbstractSurveyPlanner.java


注:本文中的org.apache.commons.math3.geometry.euclidean.threed.Vector3D.getNorm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。