Skip to content

Commit

Permalink
add ArrayFunc.tangent
Browse files Browse the repository at this point in the history
  • Loading branch information
gertjanvanzwieten committed Mar 4, 2015
1 parent 9cd416f commit 1af3db3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ def dotnorm( self, coords, ndims=0, axis=-1 ):
assert normal.shape == (self.shape[axis],)
return ( self * normal[(slice(None),)+(_,)*(self.ndim-axis-1)] ).sum( axis )

def tangent( self, geom ):
normal = geom.normal()
return self - ( self * normal ).sum(-1)[...,_] * normal

def ngrad( self, coords, ndims=0 ):
'normal gradient'

Expand Down

0 comments on commit 1af3db3

Please sign in to comment.