# Creating lists of 4D "points"

**URL:** https://cl.desmos.com/t/creating-lists-of-4d-points/8272
**Category:** Questions
**Created:** [October 3, 2025, 4:00am UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272 "2025-10-03T04:00:46Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 3, 2025, 4:00am UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/1 "2025-10-03T04:00:46Z")

</div>

I am trying to create a full 4D quaternion-based mandelbulb in desmos using definitions from .desmos.com/calculator/5aok5agmrf (I couldn’t find the original quaternion one so I settled for an octonian link by someone else). I have currently implemented it for evaluating singular points, but I can’t figure out how to make some sort of list of coordinates that 1. creates a “grid“ of 4D points and 2. works in desmos but I can also call specific parts from the list such as real, i, j, k. Desmos doesn’t support 4D points obviously and I can’t get it to work just using (X, Y)forX=, Y=, Z=, W= because there are duplicates (I was assuming each coordinate (x1, y1), (x2, y2) would count as 1 4D coordinate, so real would be L.x[1, 3, 5,…], i would be L.y[1, 3, 5,…] j would be L.x[2, 4, 6,…] ect…). After that, it should work, just testing for f(iterations)\<2 at each 4D point.

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 3, 2025, 6:21am UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/2 "2025-10-03T06:21:26Z")

</div>

That’s really interesting.  
I’m not sure I understand your issues.  
Obviously Desmos doesn’t support quaternions natively, so we have to define the operations and then we have to use a projection into the 3D space to show them.  
Can you share your code?

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 3, 2025, 3:47pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/3 "2025-10-03T15:47:15Z")

</div>

P.S. Even though I can’t get a real list of 4D points I need some sort of method to reliably do so, which is currently a+bi+cj+dk≡(a, b), (c, d)

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 3, 2025, 3:47pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/4 "2025-10-03T15:47:18Z")

</div>

Currently I have been using a system where its A\_{0}=\left(X,\ Y\right)\operatorname{for}X=a\_{0},\ Y=a\_{0}, B=\left(X,\ Y\right)\operatorname{for}X=A\_{0}.x,\ Y=A\_{0}.x, a\_{0}=\left[-1,…1\right], however testing for unique(B) says that there are tons of repeats (unique(B)\<count(B)). Then, I would do Q=\operatorname{join}\left(\left(B.x\left[1,\ 3,\ 5,…\right],\ B.y\left[1,\ 3,\ 5,…\right]\right),\ \left(B.x\left[2,\ 4,\ 6,…\right],\ B.y\left[2,\ 4,\ 6,…\right]\right)\right) because the original quaternion thing that it was based on used lists of 4 values so basically [1, 2i, 3j, 4k]. I would then call for real: \left[1,…\frac{\operatorname{length}\left(Q\right)}{4}+1\right], i: \left[\frac{\operatorname{length}\left(Q\right)}{4}+1,…\frac{2\operatorname{length}\left(Q\right)}{4}+1\right], ect… because the original functions defined from desmos .com/calculator/u6cmix4jzc used quaternions defined with lists, calling the first, second, third and fourth values for Re i j k. The problem I have here is that I build everything around being able to have a way to have a list of all of those values, stored as (Re, i), (j, k). But now I cant reliably create a 4D “Grid“ of points. My graph is here: desmos .com/calculator/xe5ebdqesx for my quaternion for lists of quaternions and desmos .com/3d/lns2moycey for mandelbulb which can evaluate singular iterations at singular 4D quaternion points.

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 3, 2025, 6:06pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/5 "2025-10-03T18:06:22Z")

</div>

So, I’m not familiar with Mandelbrot in 3D (Mandelbulb) using quaternions …  
I’m trying to understand how it works.  
In doing so I tried to simplify the code a bit and I think I found some bugs:  
[https://www.desmos.com/calculator/bypppbrprf](https://www.desmos.com/calculator/bypppbrprf)

for example if you consider the definition of M\_a  
the last factor cannot be  
y\_1[3 length(A)/4 … 4 length(A)/4+1]  
because 4 length(A)/4+1 = length(A)+1 and this is out of the bounds of the array.  
I think it should be y\_1[3 length(A)/4 … 4 length(A)/4].

So, I get that we do something similar to Mandelbrot in 2D …  
but I don’t understand when you say that the problem is the 4D grid.

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 4, 2025, 5:14pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/6 "2025-10-04T17:14:10Z")

</div>

What I was doing was defining a+bi+cj+dk as (a, b), (c, d). I could find a reliable way to generate all possible combinations of a, b, c, d where a=b=c=d=[-Range,…Range]. This is so that I can sample as many points as possible, then set a conditional where it only graphs if its inside the fractal. I basically need a way to sample every possible point that could be in the mandelbulb and then only plot if its in the fractal.

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 4, 2025, 7:59pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/7 "2025-10-04T19:59:04Z")

</div>

The problem, if I understand the situation correctly, is that you represented a quaternion with a list [(a,b), (c,d)], that is: a list of two points.  
So if you want to generate a grid of points you should do something like  
[(a,b), (c,d)] for a=Range, b=Range, c=Range, d=Range  
and this is not allowed because you would generate a list of lists (which are not supported in Desmos).

So you could represent a list of quaternions as a simple list of real values taking the elements of the list four at a time.

Otherwise you could use a function to generate all the possible values for points in your grid of quaternions, like this (see function Q):

[https://www.desmos.com/calculator/lrpvdv8dic](https://www.desmos.com/calculator/lrpvdv8dic)

for any integer value you get a quaternion of the grid

Does this help?

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [October 4, 2025, 9:49pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/8 "2025-10-04T21:49:39Z")

</div>

If I’m understanding correctly, which I don’t claim to, you want a set of unique four coordinate points? So, I’d [generate lists for each coordinate](https://www.desmos.com/calculator/vw9np5z8vf) (keeping the same order in each list comprehension is important), and function `Q_List` would return the set of coordinates at a particular index.

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 4, 2025, 9:54pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/9 "2025-10-04T21:54:28Z")

</div>

The four functions in this graph, r1 … r4 do generate the lists Daniel says …  
And the function Q(k) gives you the k-th quaternion of the list:

[https://www.desmos.com/calculator/lrpvdv8dic](https://www.desmos.com/calculator/lrpvdv8dic)

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [October 4, 2025, 10:01pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/10 "2025-10-04T22:01:15Z")

</div>

So I’m just repeating the simplest part of @Guzman_Tierno ‘s. 😆

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 4, 2025, 10:08pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/11 "2025-10-04T22:08:18Z")

</div>

YESS!!

Thank you so much I think it works now but I havent implemented it yet

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 4, 2025, 10:09pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/12 "2025-10-04T22:09:26Z")

</div>

Here’s the same code in 3D:

[https://www.desmos.com/3d/ekfu5murgy](https://www.desmos.com/3d/ekfu5murgy)

But you can only have a cubic grid whose side is smaller than 10 because otherwise the list gets bigger than 10.000 elements and this is not supported.

You can use the slider s to see a projections of the quaternions moving.

You will have to do every calculation for the Mandelbulb component-wise  
because you cannot have a list of quaternions.

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 4, 2025, 10:42pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/13 "2025-10-04T22:42:02Z")

</div>

I implemented in the original mandelbulb code and now it says “definitions are nested too deeply“

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 4, 2025, 10:42pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/14 "2025-10-04T22:42:09Z")

</div>

> **[\[Copy of\] \[Copy of\] Project #38b \[Mandelbulb Quaternion\]](https://www.desmos.com/3d/j0j0byn9e5)**
>
> Explore math with our beautiful, free online graphing calculator. Graph functions, plot points, visualize algebraic equations, add sliders, animate graphs, and more.

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 4, 2025, 10:55pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/15 "2025-10-04T22:55:19Z")

</div>

Also the power function P(x, y) doesn’t seem to be working. It keeps on returning undefined, I think the problem is the M(y, ln(x)). The multiplication function isn’t working with the decimal outputs of the ln() function

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 5, 2025, 8:25am UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/16 "2025-10-05T08:25:17Z")

</div>

I’m sorry, there are too many things together and I can’t undestand how everything works.  
I do not get the error “too deeply nested” … maybe you solved it … but on the other hand the graph doesn’t show anything.  
Maybe you can start a new graph introducing things step by step …

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 5, 2025, 2:01pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/17 "2025-10-05T14:01:55Z")

</div>

I solved the grid problem but now i have a new problem which is the Definitions are nested too deeply problem. Am I supposed to make a new topic or can I use this one?

---

<div class="post-metadata">

### Author: ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)
#### Post date: [October 5, 2025, 2:07pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/18 "2025-10-05T14:07:54Z")

</div>

You can use this one …  
I’m not getting that error … where and how do you get that error?

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 5, 2025, 9:25pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/19 "2025-10-05T21:25:17Z")

</div>

I get the nested too deeply error after I plug in everything into the iteration. Also, the power function isn’t working P(Q1, Q2)

---

<div class="post-metadata">

### Author: ![Loumen\_Cai](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/loumen_cai/32/8291_2.png) [@Loumen\_Cai](https://cl.desmos.com/u/Loumen_Cai)
#### Post date: [October 5, 2025, 9:32pm UTC](https://cl.desmos.com/t/creating-lists-of-4d-points/8272/20 "2025-10-05T21:32:13Z")

</div>

Its in the link [R Project #38b [Mandelbulb Quaternion] | Desmos](https://www.desmos.com/3d/5cagnxkezo) . The problem can be found in the “Points“folder. I was testing out f(100) for the iterations, and it said definitions nested too deeply.

[Next page](https://cl.desmos.com/t/creating-lists-of-4d-points/8272.md?page=2)
