Erlang服务器端实现代码和Python三角表面图(Tri-Surface plots)

在这里插入图片描述
-module(pro_ureq).
-behaviour(gen_fsm).
-export([start/1]).
-export([message/1]).
-export([init/1, nc_unvailable/2, nc_available/2, code_change/4, handle_info/3]).
-export([handle_event/3, terminate/3, handle_sync_event/4]).
start(AllResource) ->

gen_fsm:start_link({local, pro_ureq}, pro_ureq, AllResource, []).

message(Msg) ->
gen_fsm:send_event(pro_ureq, {button, Msg}).

%%%Callback function
nc_unvailable({button, Msg}, {_SoFar, AllResource}) ->
io:format("~p pn",[AllResource, Msg]),
{next_state, nc_available, {[], AllResource}}.
nc_available(A, State) ->
io:format(“sssssssssssssssspn”, [A]),
{next_state, nc_unvailable, State}.
init(AllResource) ->
{ok, nc_unvailable, {[], AllResource}}.
code_change(_OldVsn, StateName, StateData, _Extra) ->
{ok, StateName, StateData}.
handle_info(Info, StateName, StateData) ->
%%%%return Result
{Info, StateName, StateData}.
handle_event(Event, StateName, StateData) ->
%%%%return Result
{Event, StateName, StateData}.
terminate(_Reason, _StateName, _StateData) ->
ok.
handle_sync_event(Event, From, StateName, StateData) ->
%%%%return Result
{Event, From, StateName, StateData}.
在这里插入图片描述
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

n_radii = 8
n_angles = 36

Make radii and angles spaces (radius r=0 omitted to eliminate duplication).

radii = np.linspace(0.125, 1.0, n_radii)
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)

Repeat all angles for each radius.

angles = np.repeat(angles[…, np.newaxis], n_radii, axis=1)

Convert polar (radii, angles) coords to cartesian (x, y) coords.

(0, 0) is manually added at this stage, so there will be no duplicate

points in the (x, y) plane.

x = np.append(0, (radiinp.cos(angles)).flatten())
y = np.append(0, (radii
np.sin(angles)).flatten())

Compute z to make the pringle surface.

z = np.sin(-x*y)

fig = plt.figure()
ax = fig.gca(projection=‘3d’)

ax.plot_trisurf(x, y, z, linewidth=0.2, antialiased=True)

plt.show()
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
3、参考资料

1、https://www.cnblogs.com/xingshansi/p/6777945.html
2、CSDN:Erlang服务器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值