Changeset 59ee4db in sasmodels


Ignore:
Timestamp:
Dec 4, 2017 3:20:22 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Children:
7f79cba
Parents:
7a40b08
Message:

replace sincos with sin,cos in python cylinder example

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/codegen.py

    r50b5464 r59ee4db  
    678678    x = sin(y) + cos(z.real) 
    679679    print("world", outside) 
     680    a, b = x, y 
     681    [a, b] = (x, y) 
     682    (a, b) = [x, y] 
    680683 
    681684if __name__ == "__main__": 
  • sasmodels/models/_cylpy.py

    r13cf47a r59ee4db  
    102102import numpy as np  # type: ignore 
    103103from sasmodels.special import sas_2J1x_x, sas_sinx_x, pi, inf, sincos, square, gauss76 as gauss 
     104from sasmodels.special import sin, cos 
    104105 
    105106name = "cylinder" 
     
    154155    for i in range(gauss.n): 
    155156        theta = gauss.z[i]*zm + zb 
    156         sin_theta, cos_theta = sincos(theta) 
     157        # TODO: should be using u-substitution of cos(theta) over [0, 1] 
     158        #sin_theta, cos_theta = sincos(theta) 
     159        sin_theta = sin(theta) 
     160        cos_theta = cos(theta) 
    157161        form = fq(q*sin_theta, q*cos_theta, radius, length) 
    158162        total += gauss.w[i] * form * form * sin_theta 
Note: See TracChangeset for help on using the changeset viewer.