 |
Parametric functions on HPlot3DP canavs and 2 regions
Source code name: "func_param1.py"
Programming language: Python
Topic: Function/Parametric
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/func_param1_3531.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
"""
This example shows a few parametric functions. As example, we define
a fnction $f1$ as:
$$
x=r*\sin(2*\pi*u), \qquad y=r*\cos(2*\pi*u), \quad z=1.5*ir*\cos(\pi*v)
$$
where $ir=0.3+.1*\sin(4*\pi*u)$ and $r=ir*\sin(2*\pi*v)+0.5$
"""
from java.awt import Color
from jhplot import *
c1 = HPlot3DP("Canvas",600,600,2,1)
c1.setGTitle('3D surfaces')
c1.visible();
f1=FPR('ir=.3+.1*sin(4*Pi*u); r=ir*sin(2*Pi*v)+.5; \
x=r*sin(2*Pi*u); y=r*cos(2*Pi*u); z=1.5*ir*cos(Pi*v)')
f2=FPR('u=-2+4u; v=-2+4v; x=u-(u*u*u/3)+u*v*v; \
y=v-(v*v*v/3)+u*u*v; z=u*u-v*v; n=10; x=x/n; y=y/n; z=z/n')
c1.cd(1,1)
c1.draw(f1)
c1.cd(2,1)
c1.draw(f2)
You see the box below because you did not login.