本文整理汇总了C++中NODE::position方法的典型用法代码示例。如果您正苦于以下问题:C++ NODE::position方法的具体用法?C++ NODE::position怎么用?C++ NODE::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NODE
的用法示例。
在下文中一共展示了NODE::position方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
bool operator()(const NODE& node1, const NODE& node2) const {
double distance1 = norm(node1.position() - p_);
double distance2 = norm(node2.position() - p_);
if (distance1 < distance2)
return true;
else
return false;
}
示例2: operator
force_type operator()(NODE n, double t) {
(void) t;
force_type force = force_type(0,0,0);
Node node2;
double distance;
double initial_spring_length;
double sprint_const_this_edge;
// iterate through each neighboring node and add spring forces
for(auto it = n.edge_begin(); it != n.edge_end(); ++it)
{
node2 = (*it).node2();
sprint_const_this_edge = (*it).value().spring_constant;
initial_spring_length = (*it).value().initial_length;
distance = norm(n.position()-node2.position()); // Euclidean distance
force += (-1)*sprint_const_this_edge*(n.position()-node2.position())*(distance-initial_spring_length)/distance;
}
return force;
}
示例3: operator
Point operator()(const NODE& n) {
return {n.position().x, n.position().y, n.value().h};
}
示例4: operator
Point operator()(const NODE& node) {
return node.position();
}
示例5: operator
bool operator()(const NODE& node1, const NODE& node2) const {
Point diff1 = node1.position() - p_;
Point diff2 = node2.position() - p_;
if (norm(diff1) < norm(diff2)) return true;
return false;
}
示例6: operator
Point operator()(const NODE& n) {
// HW4B: You may change this to plot something other than the
// positions of the nodes
return Point(n.position().x, n.position().y, n.value().Q.h);
//return n.position();
}
示例7: operator
Point operator()(const NODE& node) {
return (Point(node.position().x, node.position().y, u_[node.index()]));
}
示例8: operator
Point operator()(const NODE& n) {
return Point(n.position().x, n.position().y, n.value().q.h);
}
示例9: operator
Point operator()(const NODE& n) {
// return the height stored in node value as the z direction
return Point(n.position().x, n.position().y, n.value().h);
}