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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

Mathcad Community Challenge July 2025: Projecting with Non-Euclidean Geometry

DaveMartin
16-Pearl

Mathcad Community Challenge July 2025: Projecting with Non-Euclidean Geometry

This month we have another 3D geometry challenge. We are projecting squares onto cylinders and spheres and measuring the perimeter. Create a worksheet that calculates any of the following:

 

Challenge 1: Perimeter

Calculate the perimeter of a square with a side length of 50 onto the following:

  • A sphere of diameter 100.
  • A cylinder of diameter 100 and length 100.

Clarifications:

  • Note that the square is projected from a plane that is parallel to a plane tangent to the sphere or cylinder. It is projected in a normal direction from the tangent plane as in the accompanying images.
  • For the sphere, the square is centered on the point of tangency for the plane to the sphere.
  • For the cylinder, the square is centered on the middle of the cylinder and the tangent point.
  • If the intention is unclear, please refer to the images or post a comment where the community can help explain the scenario to you.

Sphere Challenge Hidden.png

 

Cylinder Challenge Hidden.png

 

Challenge 2: Area

Calculate the area of the above projected squares.

 

Challenge 3: Function or Program

Write a function or program that computes the perimeter or area of the projected square where the inputs are the length of a side of the square and the diameter of the sphere / cylinder.

Can you incorporate error checking in situations where the projected square goes beyond the boundaries of the square or cylinder?

 

Bonus Challenge – Graphing:

Use the XY Plot, 3D Plot, or Chart Component to depict the change in perimeter or area as a function of the length of one side of the square.

 

Bonus Challenge – Advanced Input Controls:

Incorporate advanced input controls (e.g., sliders, radio buttons, etc.) to allow people to change the inputs (e.g., length of the side of a square, diameter of the cylinder / sphere) to change the results.

 

You can submit partial worksheets. For example, you can solve the first challenge and submit additional worksheets later in the month as you solve later challenges.

3D CAD models created in Creo Parametric 7 have been attached to this challenge if anyone wants to verify their calculations.

 

Find the Mathcad Community Challenge Guidelines here!

 

 

Dave Martin - dmartin@creowindchill.com - https://www.mcaeconsulting.com
30 REPLIES 30
Werner_E
25-Diamond I
(To:DaveMartin)

Hmm, a little more than a quarter of July has already passed and still no contribution has been received.
Then I would like to open the round dance.

Werner_E_0-1752031074792.png

 

Incidently, I would not say that we are practicing non-Euclidean geometry here. 😉

 

EDIT: BTW, how about adding a Gnomonic projection?

Werner_E_0-1752124596647.png

 

 

Prime 11 sheet and pdf print attached

Here is my attempt. 

I've only done the sphere so far; I might have a go at the cylinder if I find the time before the end of the month..

Although I adopted a straightforward  deterministic approach to calculating the perimeter, I decided to calculate the area using a Monte-Carlo method - just for the hell of it!

 

Alan

Werner_E
25-Diamond I
(To:DaveMartin)

New version of my sheet.

Added the Gnomonic projection and a few bits and pieces here and there.

I would really wish the sliders to work more smoothly and precisely and not wait for subsequent calculations before displaying another change. Subsequent calculations that depend on them should be canceled when the slider is moved.

 

Not sure if a stereographic projection (central projection with center ( 0 | -d/2 | 0)  ) would be worth dealing with...

Werner_E_0-1752254296604.png

 

ttokoro
21-Topaz I
(To:Werner_E)

Dear Werner_E 
I try to plot your last image. How about the perimeter or area of the projected square?

image.png

Werner_E
25-Diamond I
(To:ttokoro)

As I have already written, I was not sure whether it would be worth dealing with this case as well (meaning that I am not sure whether I would be willing to spend the time necessary 🙂  ).
I haven't dealt with this challenge since then either. There are therefore no results (yet??) for perimeter and area. The circumference should not be too difficult to determine from the four arcs. It may be an additional challenge to determine the size of the square (or rather the ratio square side/sphere radius) where the perimeter is a maximum. When the square side a is changed from 0 to infinity, the perimeter starts at zero and approaches zero again when the square side a approaches infinity.
For the area, I could imagine an implementation of Alan's Monte Carlo approach for a change. Of course the area must approach the full surface area of the sphere when a approaches infinity.
But as I said, at the moment there is only the drawing of the stereographic projection, which was easy to adapt from the existing ones.

 

AlanStevens
19-Tanzanite
(To:Werner_E)

I think that in a gnomonic projection the projection point is from the centre of the sphere, as in your earlier diagram, not from the far surface. 

Werner_E
25-Diamond I
(To:AlanStevens)


@AlanStevens wrote:

I think that in a gnomonic projection the projection point is from the centre of the sphere, as in your earlier diagram, not from the far surface. 


Correct, but the gnonomic projection is already implemented in the last (second) version of my worksheet. I added the "heigth", the distance of the square plane to the sphere as a third input parameter, but of course putting the square just in a tangential plane would suffice to cover all cases.

The same would apply to the sterographic projection which I only mentioned as being a possible additional task. There was then the corresponding drawing. However, I have not (yet?) worked on this variant.

Werner_E_0-1752735667063.png

 

AlanStevens
19-Tanzanite
(To:Werner_E)

Ah, yes!  I must read things more carefully!! 

ttokoro
21-Topaz I
(To:ttokoro)

image.png

ttokoro
21-Topaz I
(To:ttokoro)

image.png

Ok, so I have extended my earlier worksheet to include the cylinder and a couple of the other challenges.

 

Alan

 

 

EDIT:

Small (but important!) correction to error check included

Alan

 

Abandoned Challenge.png

Just an aside as we are 2/3 through the challenge. Sometimes (often?) when I come up with these things, I don't know how hard they are to solve. I initially thought, "Project a square onto a sphere? Too easy! Let's throw another angle into the mix."

Playing around in CAD, I realized that adding a tilt angle into the challenge really blows things off. The projected curve shapes get crazy even at small angles and it doesn't take much for the projection to miss intersecting with the sphere.

Anyhow, just wanted to share an element of the challenge that could have been.

 

 

Dave Martin - dmartin@creowindchill.com - https://www.mcaeconsulting.com

Even set the square z>0, the area of projected on the sphere is about 594. So, 883 must need special conditions. 

image.pngimage.png

Werner_E
25-Diamond I
(To:ttokoro)


@ttokoro wrote:

Even set the square z>0, the area of projected on the sphere is about 594. So, 883 must need special conditions. 

 


@ttokoro 

I agree - the exact requirements are not really clear from Dave's sketch. On the other hand, his contribution was not to be understood as an additional task, but rather as a “historical review” of how the task came about.

 

I strongly suspect that the projection rays should not run in the y-direction this time, but (basically as in the original challenge) at right angle to the square's plane.

The location of the square and the meaning of the measure “75” is also not clearly outlined, but I think that the center of the square is again on the y-axis and 75 units of length away from the center of the sphere

Werner_E_0-1753180813194.png

Could you confirm Dave's results with these specifications?

ttokoro
21-Topaz I
(To:Werner_E)

Center of square is on the y axis. [0 75 0].

From Wrener_E's picture, the position of center of square may a bit low, therefore, area must smaller about 5%.

image.png

Werner_E
25-Diamond I
(To:ttokoro)

????

The image alone is pretty meaningless. Apparently you couldn't verify Dave's result for the area, right?

If you're going to be working off Werner's worksheet and making edits, would you mind uploading that edited worksheet, too?

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
ttokoro
21-Topaz I
(To:DJNewman)

image.png

n is the calculation number of points foe each edge.

Θ is incline angle.

dz is offset of the square center. Still has some difference from original post.  

Can I ask you to upload the file in version 10 of Mathcad Prime? Thank you!

Werner_E
25-Diamond I
(To:ttokoro)

@ttokoro Thank's for the sheet!

However, I must admit that it was a little too confusing and undocumented for me to examine it more thoroughly. So I can't comment on its contents or correctness of calculations.
Furthermore, it seems to me that specifying the angle theta in your Prime Sheet does not change anything—the square plane remains upright and is not rotated by the angle (at least in the drawing), and the results for the perimeter and area do not change when the angle is changed so it seems to have no effect other than changing the direction of the projection rays in the drawing.
Perhaps you accidentally attached an earlier version of your work?

 

I actually didn't plan to delve deeper into this challenge, but now I am curious as to whether the area result in the picture of @DaveMartin  can still be verified and/or if we had understood correctly how he had set up the situation (regardless of the fact that it is not an 'official' additional challenge). 
Congratulations! Now you've succeeded in getting me to actually look into this type of projection again! 🙂

 

Your sheet also shows one thing about Prime that stands out as unattractive. I used the somewhat playful font “Toledo” for the texts (you can see how it looks in the PDF I also attached in my previous posts). This font seems not to be installed on your system and so Prime may therefore have chosen a replacement font that appears to have a significantly smaller character spacing. Unfortunately, Prime still remembers internally that texts are to be displayed in the “Toledo” font, even if you edit and save the file. So when I open your file the Toledo font is used and your carefully placed scale for the sliders and a few other things get thoroughly messed up. Your PDF file shows that it still looked very neat on your end.
This should not happen and significantly limits the exchange of Prime files. PTC should find a solution for this.
Here is a screenshot of how the beginning of your file looks on my computer

Werner_E_0-1753443550153.png

and here how it should look like according to your PDF

Werner_E_1-1753443697180.png

 

 

Werner_E
25-Diamond I
(To:Werner_E)

OK, I finally was able to confirm the result for the area in the picture of @DaveMartin 

My guess about the meaning of the numbers and the placing of the square and projection direction seems to have been correct.

At least I could get his result up to the first decimal.

Werner_E_4-1753447169352.png

 

I tried lower values for TOL and CTOL (never can remember which one affects numerical integration, guess its TOL) but the result remained the same. Maybe the difference is due to numerical inaccuracies in Creo??
On the other hand I get the very same value for the perimeter, 123.5994936...  ???

Werner_E_0-1753472295177.png

 

 

I did the calculations in Mathcad 15 because workflow is much faster and more efficient there. So I attach the worksheet as well as a PDF print of it.

 

EDIT: Converted the sheet to Prime 11. The symbolics in P11 does not suffer from the bug mentioned in the MC15 version of the sheet.

Otherwise the results are the very same. Attach the P11 sheet as well.

 

ttokoro
21-Topaz I
(To:Werner_E)

Thanks Werner_E your excellent mathematical solutions. 
My fomer inclined square projection only use Top and Bottom projected points to evaluate perimeter and area.

In this case, perimeter is ok but area has 5% error.

My last version using all four edges and the center of the projection but using tangent plane to the y-axis (not inclined).

Using all four edges points of inclined square, it makes almost same results.

Your matematical calculation, the area is 883.412. In my case 883.421. And  DaveMartin's Creo shows 883.429.

Increasing n=200, area is 883.414 in my method. So, your result is true. 

 

 

image.png

 

image.png

Werner_E
25-Diamond I
(To:ttokoro)


Your matematical calculation, the area is 883.412. In my case 883.421. And  DaveMartin's Creo shows 883.429.

Increasing n=200, area is 883.414 in my method. So, your result is true. 


 

Yes, I noticed that your approach is an approximation based on a large number of tiny surface elements.

My way uses the exact formula but because Primes numeric integration is used, its a similar approximation as well.

I wondered about the small difference of the result between my calculation and Dave's picture. Your response, that your result with a higher number of surface elements is closer to mine, suggests that there may indeed be a slight inaccuracy in Creo.

 

By the way, I finally got around to incorporating stereographic projection into my post.
My results confirm those shown in the image you posted.

 

Sorry for the late reply to this (getting ready to move to Spain), but here is the Creo CAD model in case anyone wants to play around with the original 3D model that sparked so much interest in the non-challenge.

Dave Martin - dmartin@creowindchill.com - https://www.mcaeconsulting.com

To be clear, I was NOT adding another challenge into the mix. I was simply saying that when I was devising this month's challenge, I thought, "What if we also tilted the plane of the square with respect to the 'horizontal'? What if we tilted the plane with respect to the 'horizontal' and the 'vertical' - see if there was a function for projected area based on 2 different angles?"

 

Well, playing around in Creo made me see that that was way too complicated. 

 

Also, looking at your image, when I did this in Creo, the center of the square was located on the "equator" of the sphere. You have the bottom edge of the square located on the equator. And yes, other factors are involved.

 

By the way, the real origin for this challenge came from... baseball. I was explaining to a friend about the rules changes a few years ago that increased the size of the bases from 15 inches to 18 inches, which reduced the distance to make it to a base or steal a base. Which got me thinking, is it really 90 feet from one base to another?

 

Dave Martin - dmartin@creowindchill.com - https://www.mcaeconsulting.com
Werner_E
25-Diamond I
(To:DaveMartin)

While I was working on the area calculation for the tilted square plane  (the bee which @DaveMartin  had put in our bonnet 😉 ) I thought that I could also finalize the additional challenge of stereographic projection that I had set.

 

The attached third version of now includes the original challenges as well as Gnomonic and Stereographic projection.

 

I had a hard time to figure out a very strange effect which I could not understand as the calculation in the final Prime sheet would not work while it does perfect in the original Mathcad 15 sheet and also in its converted Prime sheet. I finally found that the option "Units/Constants in Symbolics" was the origin of the problem (its turned on usually in my sheets but wasn't in the converted sheet) because Prime decided to auto-label variable "h" as the predefined constant now and then (seemingly arbitrary). After manually relabelling the variables as such the sheet finally also works with the option turned on. Very annoying and time consuming! Did I already mention that I ever so often start to hate this auto-label "feature"?

 

I also added initial values for the input parameters which the slider would take into account. But in the attached sheet I had disabled all those sliders because the way they and Prime's auto-calc are implemented, it was sure not fun working with the sliders. Enable them at your own risk 😉

 

Prime 11  sheet and PDF print attached

Werner_E
25-Diamond I
(To:DaveMartin)

Here is my forth and last version of my sheet.

In addition to the required specifications, gnomonic and stereographic projections have been implemented, and now Dave's non-challenge (i.e., parallel projection orthogonal to the square plane,  where that plane can be  rotated around parallels to the x and z axes) has also been added,
A consistency check of the input values has been omitted this time, which is why it can easily happen that the projection of the square does not fit entirely on the sphere. This situation is not specifically intercepted and can take up increased computing time. In this case, the results obtained are probably also unusable.

Here is an overview of the five projections covered in this sheet

Werner_E_0-1753642620326.png

 

Prime 11 sheet Rev. 4.1 and PDF print are attached

 

July 2025 ends in a couple of days, and so will the submission period for this challenge with it.

 

 

So... if there's any other ideas that other users (or lurkers willing to come forward) would like to contribute, now's the time!

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Announcements

Top Tags