- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Ways to draw a heart in JMP?
Here's one way to do it, using parametric equations found at Math World: Heart Curve.
New Table( "heart",
New Column( "t", Set Values( Index( 0, 2 * Pi(), 0.1 ) ) ),
New Column( "x", Formula( 16 * Power( Sin(t), 3 ) ) ),
New Column( "y", Formula( 13 * Cos(t) - 5 * Cos(2 * t) - 2 * Cos(3 * t) - Cos(4 * t) ) )
);
Graph Builder( Show Control Panel( 0 ), Variables( X( :x ), Y( :y ), Legend( 1 )), Elements( Formula( X, Y ) ),
SendToReport( Dispatch( {}, "400", ScaleBox,
{Legend Model( 1, Properties( 0, {Line Color( "Red" ), Line Width( 4 )} ) )})
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
DOE > Special Purpose > Space Filling Design will do it, too, with a Disallowed Combinations Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
You can also get the 3D version of this by using the appropriate heart surface as the disallowed combination expression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
Love this one!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
New Window( "heart",
Text Box(
"\!U2661",
<<setfontname( "Arial Unicode MS" ),
<<setFontScale( 20 ),
<<fontcolor( "red" )
)
);
U2661 is a heart
SetFontScale is new for JMP 13.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
This animated gif shows a web application that generates 1000 random points every time the link is clicked. It then uses a JMP neural network model exported as JavaScript to score each location. The result - inside or outside the parametric "heart" curve - is used to assign color and size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
Here's a transparent heart, built on top of the 3D equation Dan found. Running the script is way more satisfying than the picture.
Surface Plot(
Show formula( 1 ),
Mode( "Isosurface" ),
Resolution( 101 ),
Surface Color( "Red" ),
Equation( "(x^2+9*y^2/4+z^2-1)^3-x^2*z^3-9*y^2*z^3/80" ),
SetVariableAxis( x, Axis Data( {Min( -1.3 ), Max( 1.3 ), Inc( 0.5 ), Minor Ticks( 1 )} ) ),
SetVariableAxis( y, Axis Data( {Min( -2 ), Max( 3 ), Inc( 1 ), Minor Ticks( 1 )} ) ),
SetVariableAxis( z, Axis Data( {Min( -1.3 ), Max( 1.3 ), Inc( 0.5 ), Minor Ticks( 1 )} ) ),
SetXVariable( x ),
SetYVariable( y ),
Frame3D( Set Graph Size( 700, 700 ), Set Spin( 0.004, 0, -0.5, -0.3 ), Set Rotation( -90, -10, 45 ) ),
);
3D heart
The surface plot takes the equation in X,Y,Z and shows the semi-transparent iso-surface.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
These are all fantastic, really enjoyed them today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Ways to draw a heart in JMP?
Here's a way to do it using drawing functions (no data table required):
Names Default To Here( 1 );
func_HeartFilledPolygon = Function(
{},
{_HeartShapeX, _HeartShapeY, t=0::2*Pi()::0.1},
_HeartShapeY = 13 * Cos( t ) - 5 * Cos( 2 * t ) - 2 * Cos( 3 * t ) - Cos( 4 * t ) ;
_HeartShapeX = Power( Sin( t ), 3 );
Eval( Substitute( Expr( Polygon( Expr( shape_x ), Expr( shape_y ) ) ), Expr( shape_x ), _HeartShapeX, Expr( shape_y ), _HeartShapeY ) );
);
new window("Belated Valentines Day",
_ob=OutlineBox("Heart",
_hlb=HListBox(
_grbox=Graph Box(
X Scale(-1.5, 1.5),
Y Scale(-20, 15),
XName(""),
YName(""),
Fill Color("red");
func_HeartFilledPolygon();
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content