forked from arrayfire/arrayfire-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurface.py
More file actions
28 lines (21 loc) · 735 Bytes
/
surface.py
File metadata and controls
28 lines (21 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
#######################################################
# Copyright (c) 2019, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
########################################################
import arrayfire as af
af.info()
POINTS = 30
N = 2 * POINTS
x = (af.iota(d0=N, d1=1, tile_dims=(1, N)) - POINTS) / POINTS
y = (af.iota(d0=1, d1=N, tile_dims=(N, 1)) - POINTS) / POINTS
win = af.Window(800, 800, "3D Surface example using ArrayFire")
t = 0
while not win.close():
t = t + 0.07
z = 10*x*-af.abs(y) * af.cos(x*x*(y+t))+af.sin(y*(x+t))-1.5
win.surface(x, y, z)