Algorithm for creating infinite terrain/landscape/surface? [closed] - algorithm

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Does any have an algorithm for creating infinite terrain/landscape/surface?
Constraints
The algorithm should start by a random seed
The algorithm should be one to one, (the same seed gives the same result)
Other input parameter are allowed as long as 2 is fulfilled
The algorithm may output a 2d map
It suppose to create only surface with varying height (mountains), not three, ocean etc.
I’m looking for an algorithm and not a software.
It should be fast
None of other related questions in here answers this question.
If anything is unclear please let me know!

I would suggest something like Perlin noise, I've used it before for something like you're describing above, and it fits the bill. Check out this Example and you can see the sort of output you would expect from the noise generator.Here is a link to algorithm p-code too.
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

As others already said perlin noise is a possibility. Gpugems 3 has a nice capter about procedual generation using (IIRC, it has been some time since I read this) 3D Perlin noise.
Of course there are other methods too, e.g. Vterrain.org might be worth a look.

Related

How to create random incongruous shapes that don't overlap each others in P5.js [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm looking to create shapes like this :
https://www.lucegallard.com/?lightbox=dataItem-isiz1h39
But they have to be generated at random and never overlap. It would be too easy to just use beginShape() and curveVErtex(x,y), etc.
Plus the result would we static, it needs to be changed easily and randomly. My question is "is there a function to create 'weird' ellipses?" or "Could anyone help me with an algorithm to achieve this?"
Thanks allot in advance!
Stack Overflow isn't really designed for general "how do I do this" type questions. It's for specific "I tried X, expected Y, but got Z instead" type questions. But I'll try to help in a general sense:
You need to break your problem down into smaller pieces and take those pieces on one at a time. Try to create a program that just generates a single random shape. Then try to add a second randomly-generated shape that doesn't intersect with the first shape.
Think about how you would describe this program to somebody who can't see the website you've linked in your post. Try to describe it in as much detail as you can. Pretend you have a friend who has never seen what you're talking about. Can you write down a set of steps that this friend could follow to draw what you're talking about? When you have those steps written down, that's an algorithm that you can start thinking about implementing with code.
A simple check would be for each new point you generate, check whether it's inside any previous shapes. If so, go back and pick a different new point. That will at least get you started going in a direction.
If you get stuck, please post a MCVE along with a more specific technical question. Good luck.

Find duplicate images algorithm [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to create a program that find the duplicate images into a directory, something like this app does and I wonder what would be the algorithm to determine if two images are the same.
Any suggestion is welcome.
This task can be solved by perceptual-hashing, depending on your use-case, combined with some data-structure responsible for nearest-neighbor search in high-dimensions (kd-tree, ball-tree, ...) which can replace the brute-force search (somewhat).
There are tons of approaches for images: DCT-based, Wavelet-based, Statistics-based, Feature-based, CNNs (and more).
Their designs are usually based on different assumptions about the task, e.g. rotation allowed or not?
A google scholar search on perceptual image hashing will list a lot of papers. You can also look for the term image fingerprinting.
Here is some older ugly python/cython code doing the statistics-based approach.
Remark: Digikam can do that for you too. It's using some older Haar-wavelet based approach i think.

Examples of the integral that can't be done correctly by Wolfram Alpha [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Does anybody know the examples of indefinite or definite integral that can be done in the terms of elementary functions manually by a good first-year or second-year student, but which Wolfram Alpha (or Mathematica) evaluate not correctly?
In other words, I want to find some tasks for mathematical test, where students cannot easily find the answer using wolfram and just rewrite it in their papers.
Thanks in advance.
It is probably impossible. Set of functions known by 1-2 years students is constrained. Mathematica uses symbolic algebra system to transform integrals, and big repository with properties of functions.
http://functions.wolfram.com/
For example for Hypergeometric Functions you have (218,254 formulas)!
Methods of calculations of integrals are explained on wolframalpha.com as step by step solutions for pro users. ($4.75/mo billed annually or $6 billed monthly)
Calculating integrals by computers is nowadays on level comparable to chess games. You have to talk with student individually.

How does SVM work? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Is it possible to provide a high-level, but specific explanation of how SVM algorithms work?
By high-level I mean it does not need to dig into the specifics of all the different types of SVM, parameters, none of that. By specific I mean an answer that explains the algebra, versus solely a geometric interpretation.
I understand it will find a decision boundary that separates the data points from your training set into two pre-labeled categories. I also understand it will seek to do so by finding the widest possible gap between the categories and drawing the separation boundary through it. What I would like to know is how it makes that determination. I am not looking for code, rather an explanation of the calculations performed and the logic.
I know it has something to do with orthogonality, but the specific steps are very "fuzzy" everywhere I could find an explanation.
Here's a video that covers one seminal algorithm quite nicely. The big revelations for me are (1) optimize the square of the critical metric, giving us a value that's always positive, so that minimizing the square (still easily differentiable) gives us the optimum; (2) Using a simple, but not-quite-obvious "kernel trick" to make the vector classifications compute easily.
Watch carefully at how unwanted terms disappear, leaving N+1 vectors to define the gap space in N dimensions.
I'll give you a very small details that will help you to continue understanding how SVM works.
make everything simple, 2 dimensions and linearly seperable data. The general idea in SVM is to find a hyperplan that maximize the margine between two classes. each of your data is a vector from the center. One you suggest a hyperplan, you project you data vector into the vector defining the hyperplan and then you see if the length of you projected vector is before or after the hyperplan and this is how you define your two classes.
This is very simple way of seeing it, and then you can go into more details by following some papers or videos.

Python: Fit geometric forms into a board matrix? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
In the past few days i was thinking of a solution for an AI problem. The problem sounds like this:
I want to determine an arrangement for a few given geometric forms(that do not exceed the given board size) on a square board of given size, in such a way that the board will be uniform covered and the forms will
not overlap.
I want to apply Depth first search / Greedy best first search, but it feels difficult to find a proper representation of the forms and the actual board in order to traverse it. I'm new to python so that makes it a bit more difficult. Any suggestions?
Visual example:
What you are describing is a variation on rectangle/square fitting. Versions of the problem exist where unused cells have to be minimised for an optimal placement of the figures, whereas other versions, like the one you are describing, require for the whole board to be covered uniformly. These are called 'perfect square/rectangle placement' problems.
Typical ways to solve these problems involve the usage of finite integer domains representing the variables of the rectangles and a set of constraints making sure the geometrical placements are valid ones (i.e. don't cross the board borders, don't overlap with each other mutually, ..).

Resources