| 1 |
function [V] = edgsplit(V1,V2); |
| 2 |
%EDGSPLIT Split an edge by introducing a new vertex |
| 3 |
% |
| 4 |
% Usage: [V] = edgsplit(V1,V2); |
| 5 |
% |
| 6 |
% Split an edge by introducing a new vertex (perhaps at midpoint). |
| 7 |
% Handle manifolds by approximating a geodesic bisection. |
| 8 |
% |
| 9 |
% Input: |
| 10 |
% |
| 11 |
% The vertices on the endpoints of the edge to be split. |
| 12 |
% |
| 13 |
% Output: |
| 14 |
% |
| 15 |
% The new vertex representing the common endpoint of the two child edges. |
| 16 |
% |
| 17 |
% Author: Michael Holst |
| 18 |
% rcsid="$Id: edgsplit.m,v 1.1.1.1 2007/04/27 08:28:04 hrg Exp $" |
| 19 |
|
| 20 |
%%% normal bisection case in R^2 or R^3 |
| 21 |
|
| 22 |
V = zeros(1,3); |
| 23 |
V = ( V1 + V2 ) / 2.0; |
| 24 |
|
| 25 |
%%% now handle placing the new point on a taurus |
| 26 |
|
| 27 |
% r=9.900000e+00; %radius of first circle |
| 28 |
% R=10.000000e+00; %radius of second circle |
| 29 |
|
| 30 |
% Vec1=zeros(1,3); |
| 31 |
% Vec1(1:2)=V(1:2); |
| 32 |
% Vec1=R*Vec1*(1/norm(Vec1)); |
| 33 |
% Vec2=V-Vec1; |
| 34 |
% Vec2=r*Vec2*(1/norm(Vec2)); |
| 35 |
% V=Vec1+Vec2; |
| 36 |
|