cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Coloring area under curve

MM_10735997
8-Gravel

Coloring area under curve

Screenshot 2023-07-18 151025,.png

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:MM_10735997)

First you would determine the position where f(x) intersects with the horizontal.

And then you would just do the same twice using different theta limits..

Changed the approach slightly in the picture as I have added units.  It looks like Prime insists on NaN's having attached the appropriate unit, too - not really understandable.

As we use the same procedure now twice for Filla and Fillb, it sure would be a good idea to implement one of the hatch or fill functions from the other thread and using them twice or more.

Werner_E_0-1690362641460.png

 

 

View solution in original post

4 REPLIES 4
Werner_E
25-Diamond I
(To:MM_10735997)

Currently there are two recent threads here with a quite similar question:

https://community.ptc.com/t5/Mathcad/How-to-fill-a-quadrilateral-with-color/td-p/888987/jump-to/first-unread-message

https://community.ptc.com/t5/Mathcad/How-to-fill-the-area-under-the-curve-with-colours/td-p/888777/jump-to/first-unread-message

You will find some ideas there and useful functions to shade in different ways.

 

Here is a very simple and basic method to fill your plot:

Werner_E_0-1690357590610.png

Attached the Prime 9 file and it will be the last file I look at with the name "untitled"!

 

Thank you for your solution, and as you said i did found several similar posts but a bit hard to get into solution.

Also can you suggest any way to give different color to a and b.

 

Werner_E
25-Diamond I
(To:MM_10735997)

First you would determine the position where f(x) intersects with the horizontal.

And then you would just do the same twice using different theta limits..

Changed the approach slightly in the picture as I have added units.  It looks like Prime insists on NaN's having attached the appropriate unit, too - not really understandable.

As we use the same procedure now twice for Filla and Fillb, it sure would be a good idea to implement one of the hatch or fill functions from the other thread and using them twice or more.

Werner_E_0-1690362641460.png

 

 

Werner_E
25-Diamond I
(To:MM_10735997)

One last remark:

Maybe a sine approximation is more appropriate than a spline interpolation!?

Werner_E_0-1690363299463.png

Announcements

Top Tags