~hilaire-fernandes/drgeo/trunk

« back to all changes in this revision

Viewing changes to src/DrGeoII-Core/DrGLocusHomothetyItem.class.st

  • Committer: Hilaire Fernandes
  • Date: 2017-11-15 13:17:03 UTC
  • Revision ID: hilaire.fernandes@gmail.com-20171115131703-pz09obavthi53ebt
DrGeo code under Tonel file format

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Class {
 
2
        #name : #DrGLocusHomothetyItem,
 
3
        #superclass : #DrGLocusTranslationItem,
 
4
        #category : #'DrGeoII-Core-Item'
 
5
}
 
6
 
 
7
{ #category : #'xml writing' }
 
8
DrGLocusHomothetyItem >> nodeType [
 
9
        ^#Scale
 
10
]
 
11
 
 
12
{ #category : #updating }
 
13
DrGLocusHomothetyItem >> update [
 
14
        self doParentsExist ifTrue: [| locusPoints center factor|
 
15
                center := parents second point.
 
16
                factor := parents third valueItem.
 
17
                locusPoints := parents first points.
 
18
                sampleNumber := parents first samples.
 
19
                p := Array new: sampleNumber.
 
20
                1 to: sampleNumber do: [:i |
 
21
                        p at: i put: center + (factor * ((locusPoints at: i) - center))]]
 
22
]