Giter Club home page Giter Club logo

cadex's Introduction

CADEX

Тестовое задание на позицию C++ разработчика. Задание нацелено на оценку уровня владения языком программирования, математического анализа или вычислительной геометрии и способности разобраться в новом материале при необходимости.

Задание: Design a small program in C++ that would implement support of 3D curves hierarchy.

  1. Support a few types of 3D geometric curves – circles, ellipses and 3D helixes. (Simplified definitions are below). Each curve should be able to return a 3D point and a first derivative (3D vector) per parameter t along the curve.
  2. Populate a container (e.g. vector or list) of objects of these types created in random manner with random parameters.
  3. Print coordinates of points and derivatives of all curves in the container at t=PI/4.
  4. Populate a second container that would contain only circles from the first container. Make sure the second container shares (i.e. not clones) circles of the first one, e.g. via pointers.
  5. Sort the second container in the ascending order of circles’ radii. That is, the first element has the smallest radius, the last - the greatest.
  6. Compute the total sum of radii of all curves in the second container. (*) Additional optional requirements:
  7. Split implementation into a library of curves (.dll or .so) and executable which uses API of this library.
  8. Implement computation of the total sum of radii using parallel computations (e.g. OpenMP or Intel TBB library).

Requirements to the implementation:

  1. The implementation must use virtual methods.
  2. Has neither explicit memory deallocation nor memory leaks.
  3. Curves must be physically correct (e.g. radii must be positive).
  4. Containers and sorting must be implemented using STL (C++ Standard Template Library).
  5. The implementation may use constructs of C++11 or higher.
  6. The code must compile with any compiler of your choice (gcc, Visual C++, etc).

Curve definitions:

  • All curves are parametrically defined, i.e. a point is calculated using some C(t) formula.
  • Circle is planar in the plane XoY (i.e. all Z-coordinates are 0) and is defined by its radius.
  • Ellipse is planar in the plane XoY and is defined by its two radii, along X and Y axes.
  • Helix is spatial and is defined by its radius and step (see the figure below). It takes 2 * PI in parametric space to make a round, i.e. any point on helix satisfies the condition C(t + 2*PI) = C(t) + {0, 0, step}.

cadex's People

Contributors

kzerkovich avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.