# is it possible to create a kind of custom Bezier function in GeoGebra?

Niek Sprakel shared this question 2 years ago

Hi.

I'd like to create something similar to this Desmos demonstration in GeoGebra:

It involves a custom function 'f' that operates on points to yield a line or curve based on the points given.

What would be the most convenient way to accomplish this in GeoGebra?

kind regards, Niek

1

Do you just need to draw it? Then probably a locus will work.

Otherwise maybe https://wiki.geogebra.org/e... or https://wiki.geogebra.org/e...

1

Thanks, it seems that the locus function might work. I was just a bit confused about it initially because the slider used in the locus function has to be visible for the locus line to be visible.

1

I think it is a simple sequence of rotated and dilated (applying a matrix) arcs of ellipse

1

Yes, but somehow the list expressions at desmos allow for a compact formulation.

With the sequence command I think the expressions can get a bit clunky at geogebra.

Compare for example this simple construction in desmos of a bezier curve defined by three points:

In geogebra, it requires a lot more extraneous things, like the dilate function in addition to the locus function and a slider. (Example included as an attachment.)

1

This is better as it gives you an object you can actually do something with (not simply a locus) :)

https://www.geogebra.org/m/xnubqhce

1

Ah yes, but is there any way to create a function using such a parametric curve, so it can be applied to an arbitrary combination of points as input?

Something like:

f(A,B) = Curve( (1-t)x(A) + t x(B), (1-t)y(A) + t y(B), t, 0, 1)

Similar to what is possible in desmos with the expression:

f(X, Y) = ((1-t) X.x + t Y.x, (1-t) X.y + t Y.y)

1

you can create a custom tool with three points for input and a bezier curve for output

then Tool(A,B,C) will do the curve

o as Michael says

1

a cambio GG puede hacer más dinámicas algunas partes de la construccion

adjunto un esquema sin secuencias, pero crear las secuencias no tiene dificultad sobre todo si se usa el comando o la hoja de calculo

en el esquema adjunto los puntos de la circunferencia son libres bastaría con tener los angulos decididos por algun procedimiento

hay una herramienta personal para generar las matrices lo cual en GG ayuda mucho

Files: foro.ggb
1

Basically I'm just exploring Bezier curves as a means to generate biomorphic shapes, like those found in the abstract art of Jean Arp.

https://imgbox.com/g/SfpjqC4Gal

1

By the way, when exploring your foro.ggb file, I'm a bit confused about the use of the 'transfer' command.

I don't see it listed here, so I'm not sure where to find information about out how it works exactly:

https://wiki.geogebra.org/e...

1

It's a custom tool

1

Ah right.. I find these custom tools very confusing. First of all it's confusing because there doesn't seem to be a way to be aware of them in other geogebra apps besides geogebra classic, but even in geogebra classic I can see they are there in the custom tool management section, but somehow I can't see how the custom tool is defined.

1

the tool have four points A,B,C,D as input and the matrix that converts A,B to C,D as output

you can open the custom tools with tool manager of version 5 of GG

1

Ok, but I just don't see how I can view the actual way the tool is defined in GeoGebra Classic. Are you saying I have to open it in an older version (the current version of GG Classic available online is version 6) just to see the definition of the custom tool?

When I open it in version 6, I can just see the custom tool exists, but I can't see how it's defined.

https://i.imgur.com/RY1IIwI.png

1

Tool

1

I very much dislike these custom tools because they hide the way they work from the user.

1

That's a very negative comment towards someone who's given up their time to help you.

1

como decimos en español: tú mismo

https://help.geogebra.org/t...

1

Michael Borcherds, I'm just expressing my frustration about the way geogebra is very user-unfriendly regarding the way it deals with user-defined tools. Also, I was talking about custom tools as a general concept, not the particular custom tools that Claude Pelletier was showing.

It's just not what I'm after. My approach is to come up with functions or expressions to generate shapes and not to manually construct them point by point or curve by curve.

Also, I'm just clarifying what I have in mind with my question. So the answers given are not always matching what I had in mind, even though initially I might just ask about a particular aspect of something I'm trying to figure out.

1

mathmagic: Ok, in Geogebra version 5 I can actually open the custom tool, but even then I don't see how it's defined.

Where does it show me the actual definition of the custom transfer tool? How do I figure out which inputs it uses and how it computes the output?

Could you please show me a screenshot of the place in GeoGebra Classic version 5 where I can actually see the definition of the custom transfer tool or am I supposed to just guess how the input and output is related to what is shown when opening the custom tool?

1

no aconsejo bezier para eso; mejor spline()

1

Spline seems to work well https://www.geogebra.org/m/tpgmxxc7

1

Yes, but suppose you want to just generate a random collection of such biomorphic shapes without manually specifying points. Like shapes arranged in a grid to quickly explore a large selection of randomly generated shapes to identify the ones that are most aesthetically pleasing.

Similar to this (as an example of a range of generated shapes):

I suppose the Spline command would be useful for this approach.

1

I think https://www.geogebra.org/m/fttph86q will be much easier to make using Segments (with Sequence) rather than functions etc

1

How would you get areas inside sections delineated by segments to fill up cleanly?

Can you do something like the signed distance field of a line with line segments?

I'm using these inequalities because they result in clean graphics when they are combined. With other strategies there is often a slight border line between parts that are combined.

https://i.imgur.com/lR4SIZW.png

1

tenía un rato libre

¿por qué F9 no funciona? ¿Esto ha sido eliminado?

1

I think in most of the abstract art by Jean Arp, there are no loops and although there are sometimes sharp corners, they seem to occur less often than nicely rounded shapes.

So I think one would need some constraints on the curves to obtain more visually pleasing results and generally when shapes occur on top of each other, they usually tend to fit inside (without any parts sticking out beyond the boundaries of the shape below).

1

It seems a diffusion-reaction simulation might be a way to approach generating such random shapes.

With fluids, properties like surface tension often ensure that you get nicely rounded shapes.

https://i.imgur.com/2AhttOg.png

1

With a lower number of points splinart works reasonably well for generating shapes.

https://i.imgur.com/EONRNA2.png