Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

example-code.ts 676B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. export default `// Basic nodes and globs
  2. const nodeA = new Node({
  3. x: -100,
  4. y: 0,
  5. });
  6. const nodeB = new Node({
  7. x: 100,
  8. y: 0,
  9. });
  10. const glob = new Glob({
  11. start: nodeA,
  12. end: nodeB,
  13. D: { x: 0, y: 60 },
  14. Dp: { x: 0, y: 90 },
  15. });
  16. // Something more interesting...
  17. const PI2 = Math.PI * 2,
  18. center = { x: 0, y: 0 },
  19. radius = 400;
  20. let prev;
  21. for (let i = 0; i < 21; i++) {
  22. const t = i * (PI2 / 20);
  23. const node = new Node({
  24. x: center.x + radius * Math.sin(t),
  25. y: center.y + radius * Math.cos(t),
  26. });
  27. if (prev !== undefined) {
  28. new Glob({
  29. start: prev,
  30. end: node,
  31. D: center,
  32. Dp: center,
  33. });
  34. }
  35. prev = node;
  36. }
  37. `