FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire-lua/examples/graphics/plot3d.lua at master · arrayfire/arrayfire-lua · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
arrayfire
/
arrayfire-lua
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
10
Code
Issues
1
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
arrayfire-lua
/
examples
/
graphics
/
plot3d.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (31 loc) · 1.04 KB
Breadcrumbs
arrayfire-lua
/
examples
/
graphics
/
plot3d.lua
Copy path
File metadata and controls
34 lines (31 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
29
30
31
32
33
34
--[[
/*******************************************************
* Copyright (c) 2014, 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
********************************************************/
]]
--
Modules --
local
AF
=
require
(
"
arrayfire
"
)
local
ITERATIONS
=
200
local
PRECISION
=
1.0
/
ITERATIONS
AF
.
main
(
function
()
local
myWindow
=
AF
.
Window
(
800
,
800
,
"
3D Line Plot example: ArrayFire
"
)
local
t
=
0.1
local
Z
=
AF
.
array
(
AF
.
seq
(
0.1
,
10.
,
PRECISION
))
local
bounds
=
AF
.
constant
(
1
,
Z
:
dims
())
AF
.
EnvLoopUntil
(
function
()
local
Y
=
AF
.
sin
((
Z
*
t
)
+
t
)
/
Z
local
X
=
AF
.
cos
((
Z
*
t
)
+
t
)
/
Z
X
=
AF
.
max
(
AF
.
min
(
X
,
bounds
),
-
bounds
)
Y
=
AF
.
max
(
AF
.
min
(
Y
,
bounds
),
-
bounds
)
local
Pts
=
AF
.
join
(
1
,
X
,
Y
,
Z
)
--
Pts can be passed in as a matrix in the form n x 3, 3 x n
--
or in the flattened xyz-triplet array with size 3n x 1
myWindow
:
plot3
(
Pts
)
t
=
t
+
0.01
end
,
AF
.
wait_for_windows_close
(
"
until
"
,
myWindow
))
end
)
Back
|
FazBrowse Home
|
New Git URL